Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix a duplicated escaping problem on element()

The text argument of XMLFragment#element() is escaped twice.
The solution is provided by @kou.
  • Loading branch information...
commit 2cfe91ff67ea71c6750259fab9b7b589f275b78b 1 parent 409ed70
@darashi darashi authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  src/XMLFragment.coffee
  2. +6 −0 test/test.coffee
View
2  src/XMLFragment.coffee
@@ -47,7 +47,7 @@ class XMLFragment
text = '' + text or ''
text = @escape text
@assertLegalChar text
- child.text text
+ child.raw text
@children.push child
return child
View
6 test/test.coffee
@@ -156,3 +156,9 @@ test7 = builder.begin('test7')
.doc().toString()
assert.strictEqual(xml7, test7)
+# test escape of "
+xml8 = '<test8><node>&quot;</node></test8>'
+test8 = builder.begin('test8')
+ .ele('node', '"')
+ .doc().toString()
+assert.strictEqual(xml8, test8)
Please sign in to comment.
Something went wrong with that request. Please try again.