mirror of https://github.com/TriliumNext/Notes
feat(export/md): rewrite language tag to a more common syntax
parent
ba95caaf6d
commit
eee21f3741
@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue