diff --git a/apps/server/src/services/export/markdown.spec.ts b/apps/server/src/services/export/markdown.spec.ts
index 6e5eb2735..ac9d2aa04 100644
--- a/apps/server/src/services/export/markdown.spec.ts
+++ b/apps/server/src/services/export/markdown.spec.ts
@@ -176,7 +176,10 @@ describe("Markdown export", () => {
> [!IMPORTANT]
> This is a very important information.
>${space}
- >
+ > | | |
+ > | --- | --- |
+ > | 1 | 2 |
+ > | 3 | 4 |
> [!CAUTION]
> This is a caution.
@@ -342,4 +345,37 @@ describe("Markdown export", () => {
expect(markdownExportService.toMarkdown(html)).toBe(expected);
});
+ it("exports unformatted table", () => {
+ const html = trimIndentation/*html*/`\
+
+
+
+
+
+ Hi
+ |
+
+ there
+ |
+
+
+
+ Hi
+ |
+
+ there
+ |
+
+
+
+
+ `;
+ const expected = trimIndentation`\
+ | | |
+ | --- | --- |
+ | Hi | there |
+ | Hi | there |`;
+ expect(markdownExportService.toMarkdown(html)).toBe(expected);
+ });
+
});
diff --git a/apps/server/src/services/export/markdown.ts b/apps/server/src/services/export/markdown.ts
index f68a8d87e..6bbaf386d 100644
--- a/apps/server/src/services/export/markdown.ts
+++ b/apps/server/src/services/export/markdown.ts
@@ -209,6 +209,7 @@ function buildFigureFilter(): Rule {
return {
filter(node, options) {
return node.nodeName === 'FIGURE'
+ && node.classList.contains("image");
},
replacement(content, node) {
return (node as HTMLElement).outerHTML;