Escape all occurrences not only the first
This commit is contained in:
parent
1e6c89d11e
commit
8de3a234c4
@ -44,11 +44,11 @@ const COLOR_RE = new RegExp("^(#[0-9A-Fa-f]{6})(?:[0-9A-Fa-f]{2})?$");
|
|||||||
*/
|
*/
|
||||||
function escape_xml(s) {
|
function escape_xml(s) {
|
||||||
return (s
|
return (s
|
||||||
.replace("&", "&")
|
.replace(/&/g, "&")
|
||||||
.replace('"', """)
|
.replace(/"/g, """)
|
||||||
.replace("'", "'")
|
.replace(/'/g, "'")
|
||||||
.replace("<", "<")
|
.replace(/</g, "<")
|
||||||
.replace(">", ">"));
|
.replace(/>/g, ">"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user