1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-02-01 19:15:01 +02:00

HtmlToMd: Minor tweak on LI tag

This commit is contained in:
Laurent Cozic 2018-05-15 09:52:56 +01:00
parent 3c95979d94
commit 658b911513
6 changed files with 25 additions and 2 deletions

View File

@ -34,7 +34,7 @@ describe('HtmlToMd', function() {
const htmlPath = basePath + '/' + htmlFilename;
const mdPath = basePath + '/' + filename(htmlFilename) + '.md';
// if (htmlFilename !== 'list4.html') continue;
// if (htmlFilename !== 'code2.html') continue;
const html = await shim.fsDriver().readFile(htmlPath);
const expectedMd = await shim.fsDriver().readFile(mdPath);

View File

@ -0,0 +1,7 @@
<p>Subshell:</p>
<pre><code>(
set -e
false
echo Unreachable
) &amp;&amp; echo Great success
</code></pre>

View File

@ -0,0 +1,7 @@
Subshell:
(
set -e
false
echo Unreachable
) && echo Great success

View File

@ -0,0 +1,4 @@
<span>One line</span>
<span>Two lines</span>
<span>all</span><span>attached</span>

View File

@ -0,0 +1,4 @@
One line
Two lines
allattached

View File

@ -910,6 +910,7 @@ function enexXmlToMdArray(stream, resources, options = {}) {
} else if (isCodeTag(n, nodeAttributes)) {
section.lines.push(BLOCK_OPEN);
state.inCode = true;
if (n === 'pre') state.inPre = true;
} else if (n == "br") {
section.lines.push(NEWLINE);
} else if (n == "en-media") {
@ -1062,7 +1063,7 @@ function enexXmlToMdArray(stream, resources, options = {}) {
for (let i = section.lines.length - 1; i >= 0; i--) {
const line = section.lines[i];
if ([BLOCK_OPEN, BLOCK_CLOSE, NEWLINE, NEWLINE_MERGED, SPACE].indexOf(line) >= 0 || !line) {
section.lines.splice(i, 1);
section.lines[i] = ' ';
} else if (line === '- ') {
break;
}