[Pkg-javascript-commits] [ltx] 359/469: Unescape elements using # codes
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 13:03:26 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository ltx.
commit bb8980eed61a479397084883c483a4a613615679
Author: Lloyd Watkin <lloyd.watkin at surevine.com>
Date: Wed Nov 26 11:44:13 2014 +0000
Unescape elements using # codes
---
lib/sax/sax_ltx.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/sax/sax_ltx.js b/lib/sax/sax_ltx.js
index 9bb4e58..f6fc55d 100644
--- a/lib/sax/sax_ltx.js
+++ b/lib/sax/sax_ltx.js
@@ -161,10 +161,10 @@ SaxLtx.prototype.end = function(data) {
function unescapeXml(s) {
return s.
- replace(/\&/g, '&').
- replace(/\</g, '<').
- replace(/\>/g, '>').
- replace(/\"/g, '"').
- replace(/\'/g, '\'').
- replace(/\
/g, '\n')
+ replace(/\&(amp|#38);/g, '&').
+ replace(/\&(lt|#60);/g, '<').
+ replace(/\&(gt|#62);/g, '>').
+ replace(/\&(quot|#34);/g, '"').
+ replace(/\&(apos|#39);/g, '\'').
+ replace(/\&(nbsp|#160);/g, '\n')
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git
More information about the Pkg-javascript-commits
mailing list