1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

Desktop, CLI: Fixes #1476: Import lists and sub-lists from Enex files with correct indentation

This commit is contained in:
Laurent Cozic
2019-05-01 18:06:37 +01:00
parent 27f14c175f
commit b2129cb8c4
4 changed files with 28 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ describe('EnexToMd', function() {
const htmlPath = basePath + '/' + htmlFilename;
const mdPath = basePath + '/' + filename(htmlFilename) + '.md';
// if (htmlFilename !== 'text2.html') continue;
// if (htmlFilename !== 'list5.html') continue;
const html = await shim.fsDriver().readFile(htmlPath);
let expectedMd = await shim.fsDriver().readFile(mdPath);

View File

@@ -0,0 +1,16 @@
<ul>
<li lang="en-US">
<div>Protocols</div>
</li>
<ul type="circle">
<li lang="en-US">
<div>two common network protocols used to send data packets over a network</div>
</li>
<li lang="en-US">
<div>TCP Transmission control protocol</div>
</li>
</ul>
<li lang="en-US">
<div>Network port - a network port is a process-specific or an application-specific software construct serving as a communication endpoint, which is used by the Transport Layer protocols of Internet Protocol suite, such as UDP and TCP</div>
</li>
</ul>

View File

@@ -0,0 +1,7 @@
- Protocols
- two common network protocols used to send data packets over a network
- TCP Transmission control protocol
- Network port - a network port is a process-specific or an application-specific software construct serving as a communication endpoint, which is used by the Transport Layer protocols of Internet Protocol suite, such as UDP and TCP

View File

@@ -497,10 +497,12 @@ function enexXmlToMdArray(stream, resources) {
let container = state.lists[state.lists.length - 1];
container.startedText = false;
const indent = ' '.repeat(state.lists.length - 1);
if (container.tag == "ul") {
section.lines.push("- ");
section.lines.push(indent + "- ");
} else {
section.lines.push(container.counter + '. ');
section.lines.push(indent + container.counter + '. ');
container.counter++;
}
} else if (isStrongTag(n)) {