tree-sitter-html/corpus/main.txt

332 lines
6.6 KiB
Plaintext
Raw Normal View History

===================================
Tags
===================================
<span>Hello</span>
---
(fragment
(element
2018-06-12 19:20:13 +00:00
(start_tag (tag_name))
(text)
2018-06-12 19:20:13 +00:00
(end_tag (tag_name))))
===================================
Tags with attributes
===================================
<input value=yes class="a" data-💩></input>
---
(fragment
(element
(start_tag
2018-06-12 19:20:13 +00:00
(tag_name)
(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))))
===================================
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)
(element
2018-06-12 19:20:13 +00:00
(start_tag (tag_name))
(text)
2018-06-12 19:20:13 +00:00
(end_tag (tag_name)))
(text)
(element
2018-06-12 19:20:13 +00:00
(start_tag (tag_name))
(text)
2018-06-12 19:20:13 +00:00
(end_tag (tag_name)))
(text)
(end_tag (tag_name))))
==================================
Void tags
==================================
<form><img src="something.png"><br><input type=submit value=Ok /></form>
---
(fragment
(element
2018-06-12 19:20:13 +00:00
(start_tag (tag_name))
(element
(start_tag
2018-06-12 19:20:13 +00:00
(tag_name)
(attribute (attribute_name) (quoted_attribute_value (attribute_value)))))
2018-06-12 19:20:13 +00:00
(element (start_tag (tag_name)))
(element
(self_closing_tag
2018-06-12 19:20:13 +00:00
(tag_name)
(attribute (attribute_name) (attribute_value))
(attribute (attribute_name) (attribute_value))))
2018-06-12 19:20:13 +00:00
(end_tag (tag_name))))
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))))
==================================
Comments
==================================
<!-- hello -->
2018-10-29 00:56:39 +00:00
<!-- world ->-> -- > ->->->-- -> still comment -->
<div>
<!-- <span>something</span> -->
</div>
---
(fragment
2018-10-29 00:56:39 +00:00
(comment)
(comment)
2018-06-12 19:20:13 +00:00
(text)
(element
2018-06-12 19:20:13 +00:00
(start_tag (tag_name))
(comment)
2018-06-12 19:20:13 +00:00
(text)
(end_tag (tag_name))))
==================================
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>
---
(fragment
(script_element
2018-06-12 19:20:13 +00:00
(start_tag (tag_name))
(raw_text)
(end_tag (tag_name)))
(text)
(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)
(script_element
2019-10-04 12:44:44 +00:00
(start_tag (tag_name))
(raw_text)
(end_tag (tag_name)))
(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))
==================================
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))))
======================================
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))))
======================================
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))))
======================================
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))
(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))))
=======================================
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)
(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))))))
(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))))
=========================================
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)
(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
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))))