mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 06:15:48 +01:00
fix(export/markdown): math expressions not working due to string escaping
This commit is contained in:
@@ -215,13 +215,13 @@ function buildMathFilter(): Rule {
|
||||
},
|
||||
replacement(content) {
|
||||
// Inline math
|
||||
if (content.startsWith("(") && content.endsWith(")")) {
|
||||
return `$${content.substring(1, content.length - 1)}$`;
|
||||
if (content.startsWith("\\\\(") && content.endsWith("\\\\)")) {
|
||||
return `$${content.substring(3, content.length - 3)}$`;
|
||||
}
|
||||
|
||||
// Display math
|
||||
if (content.startsWith("\\[") && content.endsWith("\\]")) {
|
||||
return `$$${content.substring(2, content.length - 2)}$$`;
|
||||
if (content.startsWith(String.raw`\\\[`) && content.endsWith(String.raw`\\\]`)) {
|
||||
return `$$${content.substring(4, content.length - 4)}$$`;
|
||||
}
|
||||
|
||||
// Unknown.
|
||||
|
||||
Reference in New Issue
Block a user