From 846065916d58cf628f0bc93c74be429ecdea12e7 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 10 May 2020 21:56:05 +0300 Subject: [PATCH] fix: fix broken md headings with ampersand fixes #1173 --- src/utils/helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index f460fe14..257d0eb7 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -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, '&'); }