mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
feat(export/markdown): preserve keyboard shortcuts
This commit is contained in:
parent
80421bb220
commit
6b89bffffb
@ -97,4 +97,10 @@ describe("Markdown export", () => {
|
||||
const expected = ``;
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
it("supports keyboard shortcuts", () => {
|
||||
const html = "<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Delete</kbd>";
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(html);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -32,6 +32,7 @@ function toMarkdown(content: string) {
|
||||
instance.addRule("fencedCodeBlock", fencedCodeBlockFilter);
|
||||
instance.addRule("img", buildImageFilter());
|
||||
instance.use(turndownPluginGfm.gfm);
|
||||
instance.keep([ "kbd" ]);
|
||||
}
|
||||
|
||||
return instance.turndown(content);
|
||||
|
Loading…
x
Reference in New Issue
Block a user