Skip to content

Commit

Permalink
Added single-quote entity to XML replacement.
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Feb 24, 2009
1 parent c471281 commit 1f1e83d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ fleegix.string = new function () {
};
this.escapeXML = function (s) {
return s.replace(/&/gm, '&amp;').replace(/</gm, '&lt;').
replace(/>/gm, '&gt;').replace(/"/gm, '&quot;');
replace(/>/gm, '&gt;').replace(/"/gm, '&quot;').
replace(/'/gm, '&#39;');
};
this.unescapeXML = function (s) {
return s.replace(/&amp;/gm, '&').replace(/&lt;/gm, '<').
replace(/&gt;/gm, '>').replace(/&quot;/gm, '"');
replace(/&gt;/gm, '>').replace(/&quot;/gm, '"').
replace(/&#39;/gm, "'");;
};
};

0 comments on commit 1f1e83d

Please sign in to comment.