25-with-end-indices.json
1.85 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
"name": "withEndIndices adds correct endIndex properties",
"options": {"withStartIndices": true,"withEndIndices": true},
"streaming": false,
"html": "<!DOCTYPE html> <html> <title>The Title</title> <body class='foo'>Hello world <p></p></body> <!-- the comment --> </html> ",
"expected": [
{
"endIndex": null,
"name": "!doctype",
"data": "!DOCTYPE html",
"type": "directive"
},
{
"type": "text",
"data": " ",
"endIndex": 15
},
{
"endIndex": 120,
"type": "tag",
"name": "html",
"attribs": {},
"parent": null,
"children": [
{
"endIndex": 22,
"type": "text",
"data": " "
},
{
"endIndex": 46,
"type": "tag",
"name": "title",
"attribs": {},
"children": [
{
"endIndex": 38,
"data": "The Title",
"type": "text"
}
]
},
{
"endIndex": 47,
"type": "text",
"data": " "
},
{
"endIndex": 91,
"type": "tag",
"name": "body",
"attribs": {"class": "foo"},
"children": [
{
"endIndex": 77,
"data": "Hello world ",
"type": "text"
},
{
"endIndex": 84,
"type": "tag",
"name": "p",
"attribs": {},
"children": []
}
]
},
{
"endIndex": 92,
"type": "text",
"data": " "
},
{
"endIndex": 112,
"type": "comment",
"data": " the comment "
},
{
"endIndex": 113,
"type": "text",
"data": " "
}
]
}
]
}