mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
feat(markdown): preserve image width/height attribute
This commit is contained in:
@@ -250,4 +250,22 @@ describe("Markdown export", () => {
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
it("converts image if it has no custom properties", () => {
|
||||
const html = /*html*/`<p><img src="Include Note_image.png"></p>`;
|
||||
const expected = ``;
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
it("preserves image verbatim if it has a width or height attribute", () => {
|
||||
const scenarios = [
|
||||
`<img src="Include Note_image.png" width="16" height="16">`,
|
||||
`<img src="Include Note_image.png" width="16">`,
|
||||
`<img src="Include Note_image.png" height="16">`
|
||||
];
|
||||
for (const expected of scenarios) {
|
||||
const html = /*html*/`<p>${expected}</p>`;
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user