in stringified Text nodes, only escape &, <, >

pull/1086/head
Conduitry 8 years ago
parent dbe8105a07
commit 8c8f9703a0

@ -9,13 +9,11 @@ export function escape(data: string, { onlyEscapeAtSymbol = false } = {}) {
}
const escaped = {
'"': '&quot;',
"'": '&##39;',
'&': '&amp;',
'<': '&lt;',
'>': '&gt;'
'>': '&gt;',
};
export function escapeHTML(html) {
return String(html).replace(/["'&<>]/g, match => escaped[match]);
}
return String(html).replace(/[&<>]/g, match => escaped[match]);
}

Loading…
Cancel
Save