Unescape German umlauts (#1914)

* Unescape German umlauts

Signed-off-by: Yubiuser <ckoenig@posteo.de>
This commit is contained in:
yubiuser
2021-10-04 22:30:21 +02:00
committed by GitHub
parent 1ac7e1b50a
commit 57bf116e47

View File

@@ -31,13 +31,23 @@ function unescapeHtml(text) {
"&gt;": ">",
"&quot;": '"',
"&#039;": "'",
"&Uuml;": "Ü",
"&uuml;": "ü",
"&Auml;": "Ä",
"&auml;": "ä",
"&Ouml;": "Ö",
"&ouml;": "ö",
"&szlig;": "ß",
};
if (text === null) return null;
return text.replace(/&(?:amp|lt|gt|quot|#039);/g, function (m) {
return map[m];
});
return text.replace(
/&(?:amp|lt|gt|quot|#039|Uuml|uuml|Auml|auml|Ouml|ouml|szlig);/g,
function (m) {
return map[m];
}
);
}
// Helper function for converting Objects to Arrays after sorting the keys