Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(export/markdown): add test for jQuery-like text inside table
Elian Doran3aacd255f4ab
diff --git a/apps/server/src/services/export/markdown.spec.ts b/apps/server/src/services/export/markdown.spec.tsindex c7370a84af..de8224c5a3 100644--- a/apps/server/src/services/export/markdown.spec.ts+++ b/apps/server/src/services/export/markdown.spec.ts@@ -406,4 +406,33 @@ describe("Markdown export", () => {expect(markdownExportService.toMarkdown(html)).toBe(expected);});+ it("exports jQuery code in table properly", () => {+ const html = trimIndentation`\+ <figure class="table">+ <table>+ <thead>+ <tr>+ <th>+ Code+ </th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td>+ <pre>+ <code class="language-text-x-trilium-auto">this.$widget = $("<div>");</code>+ </pre>+ </td>+ </tr>+ </tbody>+ </table>+ </figure>+ `;+ const expected = trimIndentation`\+ <table><thead><tr><th>Code</th></tr></thead><tbody><tr><td><pre><code class="language-text-x-trilium-auto">this.$widget = $("<div>");</code>+ </pre></td></tr></tbody></table>`;+ expect(markdownExportService.toMarkdown(html)).toBe(expected);+ });+});