mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 18:42:28 +08:00
24 lines
660 B
TypeScript
24 lines
660 B
TypeScript
![]() |
import markdownExportService from "../../../src/services/export/md.js";
|
||
|
import { trimIndentation } from "../../support/utils.js";
|
||
|
|
||
|
describe("Markdown export", () => {
|
||
|
it("trims language tag for code blocks", () => {
|
||
|
const html = trimIndentation`\
|
||
|
<p>A diff:</p>
|
||
|
<pre><code class="language-text-x-diff">Hello
|
||
|
-world
|
||
|
+worldy
|
||
|
</code></pre>`;
|
||
|
const expected = trimIndentation`\
|
||
|
A diff:
|
||
|
|
||
|
\`\`\`diff
|
||
|
Hello
|
||
|
-world
|
||
|
+worldy
|
||
|
|
||
|
\`\`\``;
|
||
|
|
||
|
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||
|
});
|
||
|
});
|