UNPKG

1.41 kBJavaScriptView Raw
1// default to uppercase
2require(__dirname).test
3 ( { xml :
4 "<span class=\"test\" hello=\"world\"></span>"
5 , expect :
6 [ [ "attribute", { name: "CLASS", value: "test" } ]
7 , [ "attribute", { name: "HELLO", value: "world" } ]
8 , [ "opentag", { name: "SPAN",
9 attributes: { CLASS: "test", HELLO: "world" } } ]
10 , [ "closetag", "SPAN" ]
11 ]
12 , strict : false
13 , opt : {}
14 }
15 )
16
17// lowercase option : lowercase tag/attribute names
18require(__dirname).test
19 ( { xml :
20 "<span class=\"test\" hello=\"world\"></span>"
21 , expect :
22 [ [ "attribute", { name: "class", value: "test" } ]
23 , [ "attribute", { name: "hello", value: "world" } ]
24 , [ "opentag", { name: "span",
25 attributes: { class: "test", hello: "world" } } ]
26 , [ "closetag", "span" ]
27 ]
28 , strict : false
29 , opt : {lowercase:true}
30 }
31 )
32
33// backward compatibility with old lowercasetags opt
34require(__dirname).test
35 ( { xml :
36 "<span class=\"test\" hello=\"world\"></span>"
37 , expect :
38 [ [ "attribute", { name: "class", value: "test" } ]
39 , [ "attribute", { name: "hello", value: "world" } ]
40 , [ "opentag", { name: "span",
41 attributes: { class: "test", hello: "world" } } ]
42 , [ "closetag", "span" ]
43 ]
44 , strict : false
45 , opt : {lowercasetags:true}
46 }
47 )