1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/fork-sax/test/issue-49.js
2020-11-05 16:58:23 +00:00

33 lines
1.1 KiB
JavaScript

// https://github.com/isaacs/sax-js/issues/49
require(__dirname).test({
xml: '<xml><script>hello world</script></xml>',
expect: [
[ 'opentagstart', { name: 'xml', attributes: {} } ],
[ 'opentag', { name: 'xml', attributes: {}, isSelfClosing: false } ],
[ 'opentagstart', { name: 'script', attributes: {} } ],
[ 'opentag', { name: 'script', attributes: {}, isSelfClosing: false } ],
[ 'text', 'hello world' ],
[ 'closetag', 'script' ],
[ 'closetag', 'xml' ]
],
strict: false,
opt: { lowercasetags: true, noscript: true }
})
require(__dirname).test({
xml: '<xml><script><![CDATA[hello world]]></script></xml>',
expect: [
[ 'opentagstart', { name: 'xml', attributes: {} } ],
[ 'opentag', { name: 'xml', attributes: {}, isSelfClosing: false } ],
[ 'opentagstart', { name: 'script', attributes: {} } ],
[ 'opentag', { name: 'script', attributes: {}, isSelfClosing: false } ],
[ 'opencdata', undefined ],
[ 'cdata', 'hello world' ],
[ 'closecdata', undefined ],
[ 'closetag', 'script' ],
[ 'closetag', 'xml' ]
],
strict: false,
opt: { lowercasetags: true, noscript: true }
})