Open campar opened 3 months ago
This function translates HTML entities back to readable characters:
function decodeHtmlEntities(str: string): string {
const entities: { [key: string]: string } = {
'"': '"',
''': "'",
'<': '<',
'>': '>',
'"': '"',
''': "'",
'<': '<',
'>': '>',
'&': '&',
'&': '&',
};
return str.replace(
/&#39;|&lt;|&gt;|&quot;|&amp;|'|<|>|"|&/g,
(match) => entities[match],
);
}
Apostrophe inside response is HTML encoded for some reason.
retrieving
'
instead of apostrophe('
),