1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop, Cli: Fixes #3402: Fixed import of checkboxes in ENEX files

This commit is contained in:
Laurent Cozic 2020-06-28 18:55:47 +01:00
parent 05acc51054
commit acf1ff6d1d
2 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
<ul>
<li>
<div><input type="checkbox" onclick="return false;">Foo</div>
<div><input checked="checked" type="checkbox" onclick="return false;">Foo</div>
</li>
<li>
<div><input type="checkbox" onclick="return false;"><b>Bar</b></div>

View File

@ -123,7 +123,9 @@ function enexXmlToHtml_(stream, resources) {
section.lines = addResourceTag(section.lines, resource, nodeAttributes);
}
} else if (tagName == 'en-todo') {
section.lines.push('<input type="checkbox" onclick="return false;" />');
const nodeAttributes = attributeToLowerCase(node);
const checkedHtml = nodeAttributes.checked && nodeAttributes.checked.toLowerCase() == 'true' ? ' checked="checked" ' : ' ';
section.lines.push(`<input${checkedHtml}type="checkbox" onclick="return false;" />`);
} else if (isSelfClosingTag(tagName)) {
section.lines.push(`<${tagName}${attributesStr}/>`);
} else {