fix: fix broken md headings with ampersand

fixes #1173
This commit is contained in:
Roman Hotsiy 2020-05-10 21:56:05 +03:00
parent c88c41b9b5
commit 846065916d
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -196,5 +196,7 @@ function parseURL(url: string) {
} }
export function unescapeHTMLChars(str: string): 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, '&');
} }