diff --git a/packages/turndown-plugin-gfm/src/tables.js b/packages/turndown-plugin-gfm/src/tables.js index 7bdc0ed36..4b202f2b4 100644 --- a/packages/turndown-plugin-gfm/src/tables.js +++ b/packages/turndown-plugin-gfm/src/tables.js @@ -221,6 +221,7 @@ const tableShouldBeHtml = (tableNode, options) => { 'H6', 'HR', 'BLOCKQUOTE', + 'PRE' ]; // In general we should leave as HTML tables that include other tables. The diff --git a/src/services/export/markdown.spec.ts b/src/services/export/markdown.spec.ts index b0285b046..6baa194a2 100644 --- a/src/services/export/markdown.spec.ts +++ b/src/services/export/markdown.spec.ts @@ -193,4 +193,37 @@ describe("Markdown export", () => { expect(markdownExportService.toMarkdown(html)).toBe(expected); }); + it("exports code in tables properly", () => { + const html = trimIndentation`\ +
+ Row 1 + | +
+ Allows displaying the value of one or more attributes in the calendar + like this: +
+
+ It can also be used with relations, case in which it will display the + title of the target note:
+ |
+
Row 1 | Allows displaying the value of one or more attributes in the calendar like this:
It can also be used with relations, case in which it will display the title of the target note:
|