]]>20201223T164236Zlaurent22777@gmail.comevernote.win32
diff --git a/packages/app-cli/tests/enex_to_md/table_with_invalid_content.html b/packages/app-cli/tests/enex_to_md/table_with_invalid_content.html
new file mode 100644
index 000000000..f74f7fb2c
--- /dev/null
+++ b/packages/app-cli/tests/enex_to_md/table_with_invalid_content.html
@@ -0,0 +1,11 @@
+
+
+
one
+
two
+
+
+
+
three
+
four
+
+
\ No newline at end of file
diff --git a/packages/app-cli/tests/enex_to_md/table_with_invalid_content.md b/packages/app-cli/tests/enex_to_md/table_with_invalid_content.md
new file mode 100644
index 000000000..953d1f3a8
--- /dev/null
+++ b/packages/app-cli/tests/enex_to_md/table_with_invalid_content.md
@@ -0,0 +1,4 @@
+| | |
+| --- | --- |
+| one | two |
+| three | four |
\ No newline at end of file
diff --git a/packages/lib/import-enex-md-gen.ts b/packages/lib/import-enex-md-gen.ts
index a8a459a5d..5440e568e 100644
--- a/packages/lib/import-enex-md-gen.ts
+++ b/packages/lib/import-enex-md-gen.ts
@@ -1246,6 +1246,14 @@ function drawTable(table: Section) {
for (let tdIndex = 0; tdIndex < tr.lines.length; tdIndex++) {
const td = tr.lines[tdIndex];
+ if (typeof td === 'string') {
+ // A
tag should only have
tags as direct children.
+ // However certain Evernote notes can contain other random tags
+ // such as empty DIVs. In that case we just skip the content.
+ // See test "table_with_invalid_content.html".
+ continue;
+ }
+
if (flatRender) {
line.push(BLOCK_OPEN);