jstransformer-cdata-css
v0.1.0
Published
A transformer that transforms a CSS string into XML CDATA.
Downloads
9
Readme
jstransformer-cdata-css
Transformer that converts a CSS string to XML CDATA.
Installation
npm install jstransformer-cdata-css
API
var cdata = require('jstransformer')(require('jstransformer-cdata-css'))
var css = 'p::before { content: "hello world"; }'
console.log(cdata.render(css).body)
// Prints:
// /*<![CDATA[*/
// p::before { content: "hello world"; }
// /*]]>*/
// ']]>' is properly escaped:
css = 'p::before { content: "<[[goodbye world]]>" }'
console.log(cdata.render(css).body)
// Prints:
// /*<![CDATA[*/
// p::before { content: "<[[goodbye world]]]]><![CDATA[>" }
// /*]]>*/
License
MIT