mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
33 lines
1.1 KiB
JavaScript
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 }
|
|
})
|