diff --git a/src/utils/turndown-rules/task-items-rule.ts b/src/utils/turndown-rules/task-items-rule.ts index 81d8a0e2..d8803fa7 100644 --- a/src/utils/turndown-rules/task-items-rule.ts +++ b/src/utils/turndown-rules/task-items-rule.ts @@ -14,6 +14,6 @@ export const taskItemsRule = { const prefix = yarleOptions.outputFormat === OutputFormat.LogSeqMD ? '' : node.parentElement?.nodeName?.toUpperCase() === 'LI' ? '' : '- '; - return `${prefix}${(nodeProxy.checked.value === 'true' ? '[x]' : '[ ]')} ${content}`; + return `${prefix}${(nodeProxy.checked && nodeProxy.checked.value === 'true' ? '[x]' : '[ ]')} ${content}`; }, }; diff --git a/test/data/test-empty-en-todo.enex b/test/data/test-empty-en-todo.enex new file mode 100644 index 00000000..5ae802c9 --- /dev/null +++ b/test/data/test-empty-en-todo.enex @@ -0,0 +1,27 @@ + + + + + test-empty-en-todo + 20160804T143332Z + 20160809T172613Z + WorkLog + AU_RA + + desktop.mac + + + + + +
For this week
+
    +
  • Add view_post_X_forum variable
  • +
  • Handle the two non-_ttl variables to allow for analysis
  • +
  • Begin stepwise regression work
  • +
+

+
]]> +
+
+
diff --git a/test/data/test-empty-en-todo.md b/test/data/test-empty-en-todo.md new file mode 100644 index 00000000..57fa3d6a --- /dev/null +++ b/test/data/test-empty-en-todo.md @@ -0,0 +1,16 @@ +# test-empty-en-todo + +--- +Tag(s): #WorkLog #AU/RA + +--- + +_**For this week**_ + +* Add view\_post\_X\_forum variable +* [x] Handle the two non-\_ttl variables to allow for analysis +* [ ] Begin stepwise regression work + + Created at: 2016-08-04T15:33:32+01:00 + Updated at: 2016-08-09T18:26:13+01:00 + diff --git a/test/yarle-tests.ts b/test/yarle-tests.ts index 90fe7ce3..4a2f7044 100644 --- a/test/yarle-tests.ts +++ b/test/yarle-tests.ts @@ -460,6 +460,19 @@ export const yarleTests: Array = [ expectedOutputPath: `${dataFolder}test-sublists.md`, }, + { + name: 'Note empty en-todo', + options: { + enexSources: [ `.${testDataFolder}test-empty-en-todo.enex` ], + outputDir: 'out', + isMetadataNeeded: true, + }, + testOutputPath: `notes${path.sep}test-empty-en-todo${path.sep}test-empty-en-todo.md`, + + testModifier: YarleTestModifierOptions.only, + expectedOutputPath: `${dataFolder}test-empty-en-todo.md`, + }, + { name: 'Note with sublists (valid html)', options: {