aboutsummaryrefslogtreecommitdiff
path: root/node_modules/sax/test/issue-49.js
blob: ff2fbf75078320aeaa1908397cff0c7dcb8a9071 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// https://github.com/isaacs/sax-js/issues/49
require(__dirname).test
  ( { xml : "<xml><script>hello world</script></xml>"
    , expect :
      [ [ "opentag", { name: "xml", attributes: {}, isSelfClosing: false } ]
      , [ "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 :
      [ [ "opentag", { name: "xml", attributes: {}, isSelfClosing: false } ]
      , [ "opentag", { name: "script", attributes: {}, isSelfClosing: false } ]
      , [ "opencdata", undefined ]
      , [ "cdata", "hello world" ]
      , [ "closecdata", undefined ]
      , [ "closetag", "script" ]
      , [ "closetag", "xml" ]
      ]
    , strict : false
    , opt : { lowercasetags: true, noscript: true }
    }
  )