Skip to content

Commit

Permalink
Ignore already escaped | when building markdown table (microsoft#3281)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored May 7, 2024
1 parent 4b3489f commit b1e6a64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tspd/src/ref-doc/utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function link(text: string, url: string) {
}

function escapeMarkdownTable(text: string) {
return text.replace(/(\|)/g, "\\$1").replace(/\n/g, "<br />");
return text.replace(/([^\\])(\|)/g, "$1\\$2").replace(/\n/g, "<br />");
}

export function table([header, ...rows]: string[][]) {
Expand Down

0 comments on commit b1e6a64

Please sign in to comment.