fix(wikilinks): proper escaping of pipe character in wikilinks inside tables (#1040)

This commit is contained in:
Emile Bangma 2024-03-31 18:44:50 +02:00 committed by GitHub
parent aa4f5294a3
commit 5ec61468d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}) })