-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport noDoubleEncoding fix from xmlbuilder2.
- Loading branch information
Showing
2 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
obj = | ||
root: | ||
'@att': 'attribute value with # and #' | ||
'#text': 'HTML entities for umlaut are ü and ü.' | ||
'@att': 'attribute value with & and &' | ||
'#text': 'XML entities for ampersand are & and &.' | ||
|
||
suite 'Tests specific to issues:', -> | ||
test 'Issue #97 (No double encoding)', -> | ||
eq( | ||
xml(obj, { noDoubleEncoding: true }).end() | ||
'<?xml version="1.0"?>' + | ||
'<root att="attribute value with # and #">' + | ||
'HTML entities for umlaut are ü and ü.' + | ||
'<root att="attribute value with & and &#38;">' + | ||
'XML entities for ampersand are & and &#38;.' + | ||
'</root>' | ||
) | ||
|
||
test 'Issue #97 (Double encoding - default behavior)', -> | ||
eq( | ||
xml(obj).end() | ||
'<?xml version="1.0"?>' + | ||
'<root att="attribute value with &num; and &#35;">' + | ||
'HTML entities for umlaut are &uuml; and &#252;.' + | ||
'<root att="attribute value with &amp; and &#38;">' + | ||
'XML entities for ampersand are &amp; and &#38;.' + | ||
'</root>' | ||
) | ||
|