tree-sitter-html/corpus/main.txt

137 lines
2.2 KiB
Plaintext

===================================
Tags
===================================
<span>Hello</span>
---
(fragment
(element
(start_tag)
(text)
(end_tag)))
===================================
Tags with attributes
===================================
<input value=yes class="a" data-💩></input>
---
(fragment
(element
(start_tag
(attribute
(attribute_name)
(attribute_value))
(attribute
(attribute_name)
(quoted_attribute_value (attribute_value)))
(attribute
(attribute_name)))
(end_tag)))
===================================
Nested tags
===================================
<div>
<span>a</span>
b
<b>c</b>
</div>
---
(fragment
(element
(start_tag)
(element
(start_tag)
(text)
(end_tag))
(text)
(element
(start_tag)
(text)
(end_tag))
(end_tag)))
==================================
Void tags
==================================
<form><img src="something.png"><br><input type=submit value=Ok /></form>
---
(fragment
(element
(start_tag)
(element
(start_tag
(attribute (attribute_name) (quoted_attribute_value (attribute_value)))))
(element (start_tag))
(element
(self_closing_tag
(attribute (attribute_name) (attribute_value))
(attribute (attribute_name) (attribute_value))))
(end_tag)))
==================================
Comments
==================================
<!-- hello -->
<div>
<!-- <span>something</span> -->
</div>
---
(fragment
(comment)
(element
(start_tag)
(comment)
(end_tag)))
==================================
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))