Skip to content

Commit

Permalink
fix: fix broken md headings with ampersand
Browse files Browse the repository at this point in the history
fixes #1173
  • Loading branch information
RomanHotsiy committed May 10, 2020
1 parent c88c41b commit 8460659
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,7 @@ function parseURL(url: string) {
}

export function unescapeHTMLChars(str: string): string {
return str.replace(/&#(\d+);/g, (_m, code) => String.fromCharCode(parseInt(code, 10)));
return str
.replace(/&#(\d+);/g, (_m, code) => String.fromCharCode(parseInt(code, 10)))
.replace(/&/g, '&');
}

0 comments on commit 8460659

Please sign in to comment.