jstransformer-cdata-css

0.1.0 • Public • Published

jstransformer-cdata-css

Transformer that converts a CSS string to XML CDATA.

Build Status Coverage Status Dependency Status Greenkeeper badge NPM version

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

Package Sidebar

Install

npm i jstransformer-cdata-css

Weekly Downloads

6

Version

0.1.0

License

MIT

Last publish

Collaborators

  • calebeby
  • forbeslindesay
  • hemanth
  • robloach
  • stoeffel
  • timothygu