mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-24 14:27:56 -05:00
Fixed escapeHTML function
to skip not only &***;, but also &#***; and &x***;
This commit is contained in:
@@ -1079,7 +1079,7 @@
|
||||
|
||||
// Helper function to escape a string for HTML rendering.
|
||||
var escapeHTML = function(string) {
|
||||
return string.replace(/&(?!\w+;)/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
return string.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
Reference in New Issue
Block a user