23-dom-lvl1.json
3.33 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
"name": "DOM level 1",
"options": { "withDomLvl1": true },
"html": "<div>some stray text<h1>Hello, world.</h1><!-- comment node -->more stray text</div>",
"expected": [
{
"type": "tag",
"nodeType": 1,
"name": "div",
"tagName": "div",
"attribs": {},
"nodeValue": null,
"children": [
{
"type": "text",
"nodeType": 3,
"tagName": null,
"data": "some stray text",
"nodeValue": "some stray text",
"childNodes": null,
"firstChild": null,
"lastChild": null
},
{
"type": "tag",
"nodeType": 1,
"name": "h1",
"tagName": "h1",
"nodeValue": null,
"attribs": {},
"children": [
{
"type": "text",
"nodeType": 3,
"tagName": null,
"data": "Hello, world.",
"nodeValue": "Hello, world.",
"childNodes": null,
"firstChild": null,
"lastChild": null
}
],
"firstChild": {
"type": "text",
"nodeType": 3,
"tagName": null,
"data": "Hello, world.",
"nodeValue": "Hello, world.",
"childNodes": null,
"firstChild": null,
"lastChild": null
},
"lastChild": {
"type": "text",
"nodeType": 3,
"tagName": null,
"data": "Hello, world.",
"nodeValue": "Hello, world.",
"childNodes": null,
"firstChild": null,
"lastChild": null
}
},
{
"type": "comment",
"nodeType": 8,
"tagName": null,
"data": " comment node ",
"nodeValue": " comment node ",
"childNodes": null,
"firstChild": null,
"lastChild": null,
"prev": {
"type": "tag",
"name": "h1",
"nodeValue": null,
"attribs": {}
},
"previousSibling": {
"type": "tag",
"name": "h1",
"nodeValue": null,
"attribs": {}
},
"next": {
"type": "text",
"tagName": null,
"data": "more stray text"
},
"nextSibling": {
"type": "text",
"tagName": null,
"data": "more stray text"
}
},
{
"type": "text",
"nodeType": 3,
"tagName": null,
"data": "more stray text",
"nodeValue": "more stray text",
"childNodes": null,
"firstChild": null,
"lastChild": null,
"next": null,
"nextSibling": null
}
],
"firstChild": {
"type": "text",
"nodeType": 3,
"tagName": null,
"data": "some stray text",
"nodeValue": "some stray text",
"childNodes": null,
"firstChild": null,
"lastChild": null
},
"lastChild": {
"type": "text",
"nodeType": 3,
"tagName": null,
"data": "more stray text",
"nodeValue": "more stray text",
"childNodes": null,
"firstChild": null,
"lastChild": null
}
}
]
}