Last active
October 4, 2016 13:56
-
-
Save mk-pmb/1cfa5d53bad0698b1ec3582fbc41ecab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint indent: 2, maxlen: 80, node: true */ | |
'use strict'; | |
var xmldefuse = require("xmldefuse"), | |
rawXY = "X && <lt< >gt> 'apos' \"quot\" Y", | |
rawCD = "Have <![CDATA[ marks ]]> in ]]> text", | |
eq = require("assert").strictEqual; | |
eq(xmldefuse.cdata(rawXY), | |
"<![CDATA[X && <lt< >gt> 'apos' \"quot\" Y]]>"); | |
eq(xmldefuse.cdata(rawCD), | |
"<![CDATA[Have <![CDATA[ marks ]]]]><![CDATA[> in ]]]]><![CDATA[> text]]>"); | |
console.log('+OK test passed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html | |
%head | |
%meta{ 'http-equiv': "Content-Type", content: "text/html; charset=UTF-8" } | |
- var pageTitle = 'Test cdata mode of xmldefuse' | |
%title #{pageTitle} | |
%meta{ 'http-equiv': "Content-Script-Type", content: "text/javascript" } | |
%body.page.screen | |
%h2 #{pageTitle} | |
:javascript | |
/*jslint indent: 2, maxlen: 80, node: true */ | |
'use strict'; | |
var xmldefuse = require("xmldefuse"), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment