You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<parent text="Hello 
">
<child>Line 1
Line 2
Line 3</child>
</parent>
Expected behavior
When I set the line endings to \r\n, I'd expect both the \r and \n to not be encoded within the element text. Currently only the \n is not being encoded.
Expected Output
<parent text="Hello 
">
<child>Line 1
Line 2
Line 3</child>
</parent>
Version:
node.js: [12.6.0]
xmlbuilder2 [2.1.4]
The text was updated successfully, but these errors were encountered:
@oozcitak Just looking at 87adb72. Is it valid to have an attribute value containing \r or \n chars without them being encoded? I would have thought <parent text="Hello \r\n"> should be <parent text="Hello 
">
Describe the bug
I am building some xml which sometimes has \r\n characters in the text, which results in what feels like some inconsistent encoding behaviour. It appears to be due to https://github.com/oozcitak/xmlbuilder2/blob/master/src/writers/BaseWriter.ts#L937
I have tried removing the above line and no tests break, so I'm trying to work out why it exists? Happy to submit a PR if you think it can be removed.
To Reproduce
Actual Output
Expected behavior
When I set the line endings to \r\n, I'd expect both the \r and \n to not be encoded within the element text. Currently only the \n is not being encoded.
Expected Output
Version:
The text was updated successfully, but these errors were encountered: