summaryrefslogtreecommitdiffstats
path: root/tests/test_html/html_ast.md
blob: 0abbdeef4a3bfd7d98fdbe397b37ecde0a5bf106 (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
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
tags
.
<html>
<head>
<title class="a b" other="x">Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
.
Root('')
Tag('html')
Data('\n')
Tag('head')
Data('\n')
Tag('title', {'class': 'a b', 'other': 'x'})
Data('Title of the docu...')
Data('\n')
Data('\n')
Tag('body')
Data('\nThe content of t...')
Data('\n')
Data('\n')
.

un-closed tags
.
<div class="a">
<div class="b">
.
Root('')
Tag('div', {'class': 'a'})
Data('\n')
Tag('div', {'class': 'b'})
Data('\n')
.

xtag
.
<img src="img_girl.jpg" alt="Girl in a jacket" width="500" height="600"/>
.
Root('')
XTag('img', {'src': 'img_girl.jpg', 'alt': 'Girl in a jacket', 'width': '500', 'height': '600'})
Data('\n')
.

data
.
a
.
Root('')
Data('a\n')
.

declaration
.
<!DOCTYPE html>
.
Root('')
Declaration('DOCTYPE html')
Data('\n')
.

process information
.
<?xml-stylesheet ?>
.
Root('')
Pi('xml-stylesheet ?')
Data('\n')
.

entities
.
&amp;

&#123;
.
Root('')
Entity('amp')
Data('\n\n')
Char('123')
Data('\n')
.

comments
.
<!--This is a comment. Comments are not displayed in the browser
-->
.
Root('')
Comment('This is a comment...')
Data('\n')
.

admonition
.
<div class="admonition tip alert alert-warning">
<div class="admonition-title" style="font-weight: bold;">Tip</div>
parameter allows to get a deterministic results even if we
use some random process (i.e. data shuffling).
</div>
.
Root('')
Tag('div', {'class': 'admonition tip alert alert-warning'})
Data('\n')
Tag('div', {'class': 'admonition-title', 'style': 'font-weight: bold;'})
Data('Tip')
Data('\nparameter allows...')
Data('\n')
.

image
.
<img src="img/fun-fish.png" alt="fishy" class="bg-primary mb-1" width="200px">
<img src="img/fun-fish.png" alt="fishy" class="bg-primary mb-1" width="300px">
.
Root('')
VoidTag('img', {'src': 'img/fun-fish.png', 'alt': 'fishy', 'class': 'bg-primary mb-1', 'width': '200px'})
Data('\n')
VoidTag('img', {'src': 'img/fun-fish.png', 'alt': 'fishy', 'class': 'bg-primary mb-1', 'width': '300px'})
Data('\n')
.