Bug 13618: Add the escapeHtml JS prototype to String
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
a6f9738fd2
commit
8ee92112e4
1 changed files with 10 additions and 0 deletions
|
@ -15,6 +15,16 @@ function formatstr(str, col) {
|
|||
});
|
||||
}
|
||||
|
||||
var HtmlCharsToEscape = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>'
|
||||
};
|
||||
String.prototype.escapeHtml = function() {
|
||||
return this.replace(/[&<>]/g, function(c) {
|
||||
return HtmlCharsToEscape[c] || c;
|
||||
});
|
||||
};
|
||||
|
||||
// http://stackoverflow.com/questions/14859281/select-tab-by-name-in-jquery-ui-1-10-0/16550804#16550804
|
||||
$.fn.tabIndex = function () {
|
||||
|
|
Loading…
Reference in a new issue