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
Describe the bug
When using escaped characters like and in Js, they are converted to wrong characters in XML like 
 and 

Because of this, I am not able to add CRLF.
To Reproduce
constfinalObj={ENVELOPE: {HEADER: {TALLYREQUEST: "Line One Line Two",},};constdoc=create(finalObj);constxml=doc.end({prettyPrint: true});
<!-- Currently it's generated like this -->
<?xml version="1.0"?>
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Line One &#13;&#10; Line Two</TALLYREQUEST>
</HEADER>
</ENVELOPE>
<!-- What I Expect to generate -->
<?xml version="1.0"?>
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Line One Line Two</TALLYREQUEST>
</HEADER>
</ENVELOPE>
Expected behavior should remain and not get converted to &#13;
Version:
node.js: [12.18.3]
xmlbuilder2 [2.4.0]
Additional context
The legacy application does not understand \n. Hence I want to use these characters ( and ) as is.
The text was updated successfully, but these errors were encountered:
This is an XML builder not an HTML document builder. So has no special meaning in XML context. This behavior is expected.
That being said I understand the use case for your issue, so I have a suggestion. I am working on custom document serializers, which will allow you to convert your document into whatever format you like. This will allow you to not escape HTML characters. The issue is here if you would like to keep track: #47
Describe the bug
When using escaped characters like
and
in Js, they are converted to wrong characters in XML like&#13;
and&#10;
Because of this, I am not able to add
CRLF
.To Reproduce
Expected behavior
should remain
and not get converted to&#13;
Version:
Additional context
The legacy application does not understand
\n
. Hence I want to use these characters (
and
) as is.The text was updated successfully, but these errors were encountered: