oozcitak / xmlbuilder-js

An XML builder for node.js
MIT License
918 stars 107 forks source link

Fix bug where newlines were added at start and end of CDATA. #224

Closed MarkCSmith closed 4 years ago

MarkCSmith commented 5 years ago

Without this patch, spaces and newlines are added to elements that contain CDATA. This was a problem for our application. Without this patch, pretty printed elements which contain CDATA are output as:

<elemName>
  <![CDATA[some data here]]>
</elemName>

With this patch, the output is:

<elemName><![CDATA[some data here]]></elemName>