jstransformer-cdata
v1.0.0
Published
A transformer that transforms a string into XML CDATA.
Downloads
1,227
Readme
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