Skip to content

Commit

Permalink
fix(wikilinks): proper escaping of pipe character in wikilinks inside…
Browse files Browse the repository at this point in the history
… tables (#1040)
  • Loading branch information
saberzero1 authored Mar 31, 2024
1 parent aa4f529 commit 5ec6146
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quartz/plugins/transformers/ofm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
const [raw]: (string | undefined)[] = capture
let escaped = raw ?? ""
escaped = escaped.replace("#", "\\#")
escaped = escaped.replace("|", "\\|")
// escape pipe characters if they are not already escaped
escaped = escaped.replace(/((^|[^\\])(\\\\)*)\|/g, "$1\\|")

return escaped
})
Expand Down

0 comments on commit 5ec6146

Please sign in to comment.