Install
jstransformer-foo
JSTransformer that converts a string to an XML CDATA.
Installation
npm install jstransformer-cdata
API
var cdata = require('jstransformer')(require('jstransformer-cdata'))
cdata.render('hello world').body
//=> '<![CDATA[hello world]]>'
// ']]>' is properly escaped:
cdata.render('<[[goodbye world]]>').body
//=> '<![CDATA[<[[goodbye world]]]]><![CDATA[>]]>'
License
MIT