fix(wikilinks): proper escaping of pipe character in wikilinks inside tables (#1040)
This commit is contained in:
parent
aa4f5294a3
commit
5ec61468d5
@ -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 New Issue
Block a user