Skip to content

Commit

Permalink
Desktop, Cli: Fixes #3402: Fixed import of checkboxes in ENEX files
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed Jun 28, 2020
1 parent 05acc51 commit acf1ff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CliClient/tests/enex_to_html/checklist-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 3 additions & 1 deletion ReactNativeClient/lib/import-enex-html-gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit acf1ff6

Please sign in to comment.