jstransformers / jstransformer-cdata-js

Transform a JavaScript string to XML CDATA.
http://npmjs.com/jstransformer-cdata-js
MIT License
0 stars 0 forks source link

jstransformer-cdata-js

XML CDATA support for JSTransformers.

Build Status Coverage Status Dependency Status NPM version

Installation

npm install jstransformer-cdata-js

API

var cdata = require('jstransformer')(require('jstransformer-cdata-js'))

cdata.render('"hello world"').body
// <![CDATA[
// "hello world"
// //]]>

// ']]>' is properly escaped:
cdata.render('var str = "<[[goodbye world]]>"').body
// <![CDATA[
// var str = "<[[goodbye world]]]]><![CDATA[>"
// //]]>

License

MIT