<?xml version="1.0" encoding="UTF-8"?>
<itemizer language-context="html">

	<item name="built-in.ie-conditional.comment">
		<class>ESCommentItem</class>
		<zone>comment.conditional:has-child(conditional.start:has-child(condition:capture(name)))</zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<item name="built-in.comment">
		<class>ESCommentItem</class>
		<zone>comment</zone>
	</item>
	
	<item name="built-in.html.tag.collection.root">
		<start-zone>tag.open.x-html:has-child(name:capture(name))</start-zone>
		<end-zone>tag.close.x-html</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
		<class>ESXHTMLItem</class>
	</item>
	
	<!-- Special cases for the most common HTML5 optional end tags -->
	<!-- http://www.w3.org/TR/html5/syntax.html#syntax-tag-omission -->
	
	<item name="built-in.html.tag.collection.paragraph">
		<start-zone>tag.open.x-p:has-child(name:capture(name))</start-zone>
		<end-zone>tag.close.x-p</end-zone>
		<!-- This is actually a bit too broad, but oh well -->
		<end-before-zone>tag.open.block, tag.open.x-hr</end-before-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
		<class>ESXHTMLItem</class>
	</item>
	
	<item name="built-in.html.tag.collection.list">
		<start-zone>tag.open.x-li:has-child(name:capture(name))</start-zone>
		<end-zone>tag.close.x-li</end-zone>
		<end-before-zone>tag.open.x-li</end-before-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
		<class>ESXHTMLItem</class>
	</item>
	
	<item name="built-in.html.tag.collection.option">
		<start-zone>tag.open.x-option:has-child(name:capture(name))</start-zone>
		<end-zone>tag.close.x-option</end-zone>
		<end-before-zone>tag.open.x-option, tag.open.x-optgroup</end-before-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
		<class>ESXHTMLItem</class>
	</item>
	
	<!-- Default tag handling -->
	
	<item name="built-in.self-closing-tag">
		<zone>tag.self-closing:has-child(name:capture(name)), tag.open:has-child(name:capture(name), self-closing)</zone>
		<class>ESXHTMLItem</class>
	</item>
	
	<item name="built-in.html.tag.collection">
		<start-zone>tag.open:has-child(name:capture(name))</start-zone>
		<end-zone>tag.close:has-child(name[text == $name.text])</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
		<class>ESXHTMLItem</class>
	</item>
	
</itemizer>