Skip to content
This repository was archived by the owner on Jan 7, 2021. It is now read-only.

Commit b9b044c

Browse files
author
Edwin Hoogerbeets
committed
Test special chars escaped by node-expat in attr values and regular text
1 parent be0bf41 commit b9b044c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/sanitize.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
var charsEscape = {
1717
'&': '&',
1818
'<': '&lt;',
19-
'>': '&gt;',
20-
"\u001F": "&#31;"
19+
'>': '&gt;'
2120
};
2221

2322
var charsUnescape = {

test/fixtures/xmlsanitize.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"e":{"a":{"b":"Smith & Son","$t":"Movers & <b>Shakers</b> Extraordinaire"}}}
1+
{"e":{"a":{"b":"<\"Smith\" & 'Son'>","$t":"Movers & <b>Shakers</b> Extraordinaire #()\"'"}}}

test/fixtures/xmlsanitize.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<e><a b="Smith &amp; Son">Movers &amp; &lt;b&gt;Shakers&lt;/b&gt; Extraordinaire</a></e>
1+
<e><a b="&lt;&quot;Smith&quot; &amp; &apos;Son&apos;&gt;">Movers &amp; &lt;b&gt;Shakers&lt;/b&gt; Extraordinaire #()"'</a></e>

0 commit comments

Comments
 (0)