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) {
|
||||
return (s
|
||||
.replace("&", "&")
|
||||
.replace('"', """)
|
||||
.replace("'", "'")
|
||||
.replace("<", "<")
|
||||
.replace(">", ">"));
|
||||
.replace(/&/g, "&")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user