2018-06-11 20:18:00 +00:00
|
|
|
===================================
|
|
|
|
Tags
|
|
|
|
===================================
|
|
|
|
<span>Hello</span>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
2018-06-12 19:20:13 +00:00
|
|
|
(end_tag (tag_name))))
|
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-12 19:20:13 +00:00
|
|
|
(tag_name)
|
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-12 19:20:13 +00:00
|
|
|
(end_tag (tag_name))))
|
2018-06-11 20:18:00 +00:00
|
|
|
|
|
|
|
===================================
|
|
|
|
Nested tags
|
|
|
|
===================================
|
|
|
|
<div>
|
|
|
|
<span>a</span>
|
|
|
|
b
|
|
|
|
<b>c</b>
|
|
|
|
</div>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
2018-06-11 20:18:00 +00:00
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
2018-06-12 19:20:13 +00:00
|
|
|
(end_tag (tag_name)))
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
2018-06-11 20:18:00 +00:00
|
|
|
(text)
|
2018-06-12 19:20:13 +00:00
|
|
|
(end_tag (tag_name)))
|
|
|
|
(text)
|
|
|
|
(end_tag (tag_name))))
|
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-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
2018-06-11 22:12:01 +00:00
|
|
|
(element
|
|
|
|
(start_tag
|
2018-06-12 19:20:13 +00:00
|
|
|
(tag_name)
|
2018-06-11 20:18:00 +00:00
|
|
|
(attribute (attribute_name) (quoted_attribute_value (attribute_value)))))
|
2018-06-12 19:20:13 +00:00
|
|
|
(element (start_tag (tag_name)))
|
2018-06-11 22:12:01 +00:00
|
|
|
(element
|
2018-06-11 20:18:00 +00:00
|
|
|
(self_closing_tag
|
2018-06-12 19:20:13 +00:00
|
|
|
(tag_name)
|
2018-06-11 20:18:00 +00:00
|
|
|
(attribute (attribute_name) (attribute_value))
|
|
|
|
(attribute (attribute_name) (attribute_value))))
|
2018-06-12 19:20:13 +00:00
|
|
|
(end_tag (tag_name))))
|
2018-06-11 22:36:18 +00:00
|
|
|
|
2018-06-12 21:06:16 +00:00
|
|
|
==================================
|
|
|
|
Void tags at EOF
|
|
|
|
==================================
|
|
|
|
<img src="something.png">
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
|
|
|
(start_tag
|
|
|
|
(tag_name)
|
|
|
|
(attribute (attribute_name) (quoted_attribute_value (attribute_value))))))
|
|
|
|
|
2018-06-12 21:03:51 +00:00
|
|
|
==================================
|
|
|
|
Custom tags
|
|
|
|
==================================
|
|
|
|
<something:different>
|
|
|
|
<atom-text-editor mini>
|
|
|
|
Hello
|
|
|
|
</atom-text-editor>
|
|
|
|
</something:different>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
|
|
|
(element
|
|
|
|
(start_tag (tag_name) (attribute (attribute_name)))
|
|
|
|
(text)
|
|
|
|
(end_tag (tag_name)))
|
|
|
|
(text)
|
|
|
|
(end_tag (tag_name))))
|
|
|
|
|
2018-06-11 22:36:18 +00:00
|
|
|
==================================
|
|
|
|
Comments
|
|
|
|
==================================
|
|
|
|
<!-- hello -->
|
2018-10-29 00:56:39 +00:00
|
|
|
<!-- world ->-> -- > ->->->-- -> still comment -->
|
2018-06-11 22:36:18 +00:00
|
|
|
<div>
|
|
|
|
<!-- <span>something</span> -->
|
|
|
|
</div>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
2018-10-29 00:56:39 +00:00
|
|
|
(comment)
|
2018-06-11 22:36:18 +00:00
|
|
|
(comment)
|
2018-06-12 19:20:13 +00:00
|
|
|
(text)
|
2018-06-11 22:36:18 +00:00
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
2018-06-11 22:36:18 +00:00
|
|
|
(comment)
|
2018-06-12 19:20:13 +00:00
|
|
|
(text)
|
|
|
|
(end_tag (tag_name))))
|
2018-06-11 23:56:33 +00:00
|
|
|
|
|
|
|
==================================
|
|
|
|
Raw text elements
|
|
|
|
==================================
|
|
|
|
<script>
|
|
|
|
</s
|
|
|
|
</sc
|
|
|
|
</scr
|
|
|
|
</scri
|
|
|
|
</scrip
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</ </s </st </sty </styl
|
|
|
|
</style>
|
|
|
|
|
2019-10-04 12:44:44 +00:00
|
|
|
<script>
|
|
|
|
</SCRIPT>
|
|
|
|
|
2018-06-11 23:56:33 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
2018-12-15 01:43:41 +00:00
|
|
|
(script_element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(raw_text)
|
|
|
|
(end_tag (tag_name)))
|
|
|
|
(text)
|
2018-12-15 01:43:41 +00:00
|
|
|
(style_element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(raw_text)
|
|
|
|
(end_tag (tag_name)))
|
2019-10-04 12:44:44 +00:00
|
|
|
(text)
|
2019-10-04 12:48:11 +00:00
|
|
|
(script_element
|
2019-10-04 12:44:44 +00:00
|
|
|
(start_tag (tag_name))
|
2019-10-04 12:48:11 +00:00
|
|
|
(raw_text)
|
|
|
|
(end_tag (tag_name)))
|
|
|
|
(text))
|
2018-06-11 23:56:33 +00:00
|
|
|
|
|
|
|
==================================
|
|
|
|
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))
|
2018-06-12 17:51:03 +00:00
|
|
|
|
|
|
|
==================================
|
|
|
|
LI elements without close tags
|
|
|
|
==================================
|
|
|
|
<ul>
|
|
|
|
<li>One
|
|
|
|
<li>Two
|
|
|
|
</ul>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(end_tag (tag_name))))
|
2018-06-12 17:51:03 +00:00
|
|
|
|
|
|
|
======================================
|
|
|
|
DT and DL elements without close tags
|
|
|
|
======================================
|
|
|
|
<dl>
|
|
|
|
<dt>Coffee
|
|
|
|
<dt>Café
|
|
|
|
<dd>Black hot drink
|
|
|
|
<dt>Milk
|
|
|
|
<dd>White cold drink
|
|
|
|
</dl>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(end_tag (tag_name))))
|
2018-06-12 17:51:03 +00:00
|
|
|
|
|
|
|
======================================
|
|
|
|
P elements without close tags
|
|
|
|
======================================
|
|
|
|
<p>One
|
|
|
|
<div>Two</div>
|
|
|
|
<p>Three
|
|
|
|
<p>Four
|
|
|
|
<h1>Five</h1>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
2018-06-12 19:20:13 +00:00
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text) (end_tag (tag_name)))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text) (end_tag (tag_name))))
|
2018-06-12 17:51:03 +00:00
|
|
|
|
|
|
|
======================================
|
|
|
|
Ruby annotation elements without close tags
|
|
|
|
======================================
|
|
|
|
<ruby>東<rb>京<rt>とう<rt>きょう</ruby>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
2018-06-12 17:51:03 +00:00
|
|
|
(text)
|
2018-06-12 19:20:13 +00:00
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(end_tag (tag_name))))
|
2018-06-12 17:51:03 +00:00
|
|
|
|
|
|
|
=======================================
|
|
|
|
COLGROUP elements without end tags
|
|
|
|
=======================================
|
|
|
|
<table>
|
|
|
|
<colgroup>
|
|
|
|
<col style="background-color: #0f0">
|
|
|
|
<col span="2">
|
|
|
|
<tr>
|
|
|
|
<th>Lime</th>
|
|
|
|
<th>Lemon</th>
|
|
|
|
<th>Orange</th>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
2018-06-12 17:51:03 +00:00
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
|
|
|
(element (start_tag
|
|
|
|
(tag_name)
|
|
|
|
(attribute (attribute_name) (quoted_attribute_value (attribute_value)))))
|
|
|
|
(element (start_tag
|
|
|
|
(tag_name)
|
|
|
|
(attribute (attribute_name) (quoted_attribute_value (attribute_value))))))
|
2018-06-12 17:51:03 +00:00
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text) (end_tag (tag_name)))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text) (end_tag (tag_name)))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text) (end_tag (tag_name)))
|
|
|
|
(text)
|
|
|
|
(end_tag (tag_name)))
|
|
|
|
(text)
|
|
|
|
(end_tag (tag_name))))
|
2018-06-12 17:51:03 +00:00
|
|
|
|
|
|
|
=========================================
|
|
|
|
TR, TD, and TH elements without end tags
|
|
|
|
=========================================
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>One
|
|
|
|
<th>Two
|
|
|
|
<tr>
|
|
|
|
<td>Three
|
|
|
|
<td>Four
|
|
|
|
</table>
|
|
|
|
---
|
|
|
|
|
|
|
|
(fragment
|
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
2018-06-12 17:51:03 +00:00
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text)))
|
2018-06-12 17:51:03 +00:00
|
|
|
(element
|
2018-06-12 19:20:13 +00:00
|
|
|
(start_tag (tag_name))
|
|
|
|
(text)
|
|
|
|
(element (start_tag (tag_name)) (text))
|
|
|
|
(element (start_tag (tag_name)) (text)))
|
|
|
|
(end_tag (tag_name))))
|