2018-06-11 20:18:00 +00:00
|
|
|
===================================
|
|
|
|
Tags
|
|
|
|
===================================
|
|
|
|
<span>Hello</span>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-11 22:12:01 +00:00
|
|
|
(start_tag)
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
2018-06-11 22:12:01 +00:00
|
|
|
(end_tag)))
|
2018-06-11 20:18:00 +00:00
|
|
|
|
|
|
|
===================================
|
|
|
|
Tags with attributes
|
|
|
|
===================================
|
|
|
|
<input value=yes class="a" data-💩></input>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
2018-06-11 22:12:01 +00:00
|
|
|
(element
|
|
|
|
(start_tag
|
2018-06-11 20:18:00 +00:00
|
|
|
(attribute
|
|
|
|
(attribute_name)
|
|
|
|
(attribute_value))
|
|
|
|
(attribute
|
|
|
|
(attribute_name)
|
|
|
|
(quoted_attribute_value (attribute_value)))
|
|
|
|
(attribute
|
|
|
|
(attribute_name)))
|
2018-06-11 22:12:01 +00:00
|
|
|
(end_tag)))
|
2018-06-11 20:18:00 +00:00
|
|
|
|
|
|
|
===================================
|
|
|
|
Nested tags
|
|
|
|
===================================
|
|
|
|
<div>
|
|
|
|
<span>a</span>
|
|
|
|
b
|
|
|
|
<b>c</b>
|
|
|
|
</div>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-11 22:12:01 +00:00
|
|
|
(start_tag)
|
2018-06-11 20:18:00 +00:00
|
|
|
(element
|
2018-06-11 22:12:01 +00:00
|
|
|
(start_tag)
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
2018-06-11 22:12:01 +00:00
|
|
|
(end_tag))
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
|
|
|
(element
|
2018-06-11 22:12:01 +00:00
|
|
|
(start_tag)
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
2018-06-11 22:12:01 +00:00
|
|
|
(end_tag))
|
|
|
|
(end_tag)))
|
2018-06-11 20:18:00 +00:00
|
|
|
|
|
|
|
==================================
|
|
|
|
Void tags
|
|
|
|
==================================
|
2018-06-11 22:12:01 +00:00
|
|
|
<form><img src="something.png"><br><input type=submit value=Ok /></form>
|
2018-06-11 20:18:00 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-11 22:12:01 +00:00
|
|
|
(start_tag)
|
|
|
|
(element
|
|
|
|
(start_tag
|
2018-06-11 20:18:00 +00:00
|
|
|
(attribute (attribute_name) (quoted_attribute_value (attribute_value)))))
|
2018-06-11 22:12:01 +00:00
|
|
|
(element (start_tag))
|
|
|
|
(element
|
2018-06-11 20:18:00 +00:00
|
|
|
(self_closing_tag
|
|
|
|
(attribute (attribute_name) (attribute_value))
|
|
|
|
(attribute (attribute_name) (attribute_value))))
|
2018-06-11 22:12:01 +00:00
|
|
|
(end_tag)))
|
2018-06-11 22:36:18 +00:00
|
|
|
|
|
|
|
==================================
|
|
|
|
Comments
|
|
|
|
==================================
|
|
|
|
<!-- hello -->
|
|
|
|
<div>
|
|
|
|
<!-- <span>something</span> -->
|
|
|
|
</div>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(comment)
|
|
|
|
(element
|
|
|
|
(start_tag)
|
|
|
|
(comment)
|
|
|
|
(end_tag)))
|
2018-06-11 23:56:33 +00:00
|
|
|
|
|
|
|
==================================
|
|
|
|
Raw text elements
|
|
|
|
==================================
|
|
|
|
|
|
|
|
<script>
|
|
|
|
</s
|
|
|
|
</sc
|
|
|
|
</scr
|
|
|
|
</scri
|
|
|
|
</scrip
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</ </s </st </sty </styl
|
|
|
|
</style>
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(raw_element
|
|
|
|
(start_tag)
|
|
|
|
(end_tag))
|
|
|
|
(raw_element
|
|
|
|
(start_tag)
|
|
|
|
(end_tag))
|
|
|
|
(text))
|
|
|
|
|
|
|
|
==================================
|
|
|
|
All-caps doctype
|
|
|
|
==================================
|
|
|
|
<!DOCTYPE html PUBLIC
|
|
|
|
"-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(doctype))
|
|
|
|
|
|
|
|
==================================
|
|
|
|
Lowercase doctype
|
|
|
|
==================================
|
|
|
|
<!doctype html>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(doctype))
|