mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 19:46:23 +00:00
fix(wikilinks): proper escaping of pipe character in wikilinks inside tables (#1040)
This commit is contained in:
parent
aa4f5294a3
commit
5ec61468d5
1 changed files with 2 additions and 1 deletions
|
@ -188,7 +188,8 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||||
const [raw]: (string | undefined)[] = capture
|
const [raw]: (string | undefined)[] = capture
|
||||||
let escaped = raw ?? ""
|
let escaped = raw ?? ""
|
||||||
escaped = escaped.replace("#", "\\#")
|
escaped = escaped.replace("#", "\\#")
|
||||||
escaped = escaped.replace("|", "\\|")
|
// escape pipe characters if they are not already escaped
|
||||||
|
escaped = escaped.replace(/((^|[^\\])(\\\\)*)\|/g, "$1\\|")
|
||||||
|
|
||||||
return escaped
|
return escaped
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue