feat(markdown): use different approach for reference links

This commit is contained in:
Elian Doran
2025-04-05 02:31:52 +03:00
parent 4f22850ea9
commit 6a69e9b208
4 changed files with 60 additions and 19 deletions

View File

@@ -238,9 +238,15 @@ describe("Markdown export", () => {
expect(markdownExportService.toMarkdown(html)).toBe(expected);
});
it("exports reference links as normal links", () => {
it("exports normal links verbatim", () => {
const html = /*html*/`<p><a href="https://www.google.com">Google</a></p>`;
const expected = `[Google](https://www.google.com)`;
expect(markdownExportService.toMarkdown(html)).toBe(expected);
});
it("exports reference links verbatim", () => {
const html = /*html*/`<p><a class="reference-link" href="../../Canvas.html">Canvas</a></p>`;
const expected = `[Canvas](../../Canvas.html)`;
const expected = `<a class="reference-link" href="../../Canvas.html">Canvas</a>`;
expect(markdownExportService.toMarkdown(html)).toBe(expected);
});