mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
feat(export/md): rewrite language tag to a more common syntax
This commit is contained in:
24
spec/services/export/md.spec.ts
Normal file
24
spec/services/export/md.spec.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user