1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/fork-sax/test/issue-49.js

33 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2020-11-05 18:58:23 +02:00
// 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 }
})