mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
All escaping functions replace HTML reserved characters.
This commit is contained in:
parent
30da7357e5
commit
6e36b59a59
4 changed files with 20 additions and 5 deletions
|
@ -23,7 +23,14 @@
|
|||
var padutils = {
|
||||
escapeHtml: function(x)
|
||||
{
|
||||
return String(x).replace(/\</g, '<').replace(/\>/g, '>');
|
||||
return String(x).replace(/[&"<>]/g, function (c) {
|
||||
return {
|
||||
'&': '&',
|
||||
'"': '"',
|
||||
'<': '<',
|
||||
'>': '>'
|
||||
}[c] || c;
|
||||
});
|
||||
},
|
||||
uniqueId: function()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue