Closed sknox131 closed 2 years ago
Thank you for the heads up, will look into this as soon as I can!
Thank you, I believe this is now fixed in v3 for CDATA automatically, please try it out. Thank you!
Example:
const content = {
foo: {
bar: `<![CDATA[
<B>Bold the letters in the content <EM>Next</EM>part.</B>
]]>`,
baz: 's'
}
};
const config = { indent: ' ' };
toXML(content, config);
/*
Output:
`<foo>
<bar><![CDATA[
<B>Bold the letters in the content <EM>Next</EM>part.</B>
]]></bar>
<baz>s</baz>
</foo>`
*/
Perfect! Thank you!
I am using your library to write bpmn and need an effective way to write CDATA. Right now, when I output my xml, it puts an indent after a CDATA value. I noticed in the code that there is a flag for marking complex xml values such that if there is an open bracket in the value, then an indent and a newline will be added to the document. Can there be an option to get around this? Possibly an '_xmlIsSimple' xml option? Or potentially some way to create CDATA without writing out the open and close brackets myself?