mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 02:05:53 +01:00
feat(import/markdown): import in-display math properly
This commit is contained in:
@@ -12,7 +12,13 @@ class CustomMarkdownRenderer extends Renderer {
|
||||
}
|
||||
|
||||
paragraph(data: Tokens.Paragraph): string {
|
||||
return super.paragraph(data).trimEnd();
|
||||
let text = super.paragraph(data).trimEnd();
|
||||
|
||||
// Display math
|
||||
text = text.replaceAll(/\$\$(.+)\$\$/g,
|
||||
`<span class="math-tex">\\\[$1\\\]</span>`);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
code({ text, lang }: Tokens.Code): string {
|
||||
|
||||
Reference in New Issue
Block a user