jstransformer-cdata-css
Transformer that converts a CSS string to XML CDATA.
Installation
npm install jstransformer-cdata-css
API
var cdata = var css = 'p::before { content: "hello world"; }'console// Prints:// /*<![CDATA[*/// p::before { content: "hello world"; }// /*]]>*/ // ']]>' is properly escaped:css = 'p::before { content: "<[[goodbye world]]>" }'console// Prints:// /*<![CDATA[*/// p::before { content: "<[[goodbye world]]]]><![CDATA[>" }// /*]]>*/
License
MIT