- Whitespace-sensitive elements are left alone
- Content inside <pre>, <textarea>, <script> and <style> is emitted exactly as written. Re-indenting a <pre> block would change what the page displays, and reformatting script contents could break string literals, so those regions are treated as opaque.
- Unclosed tags are reported
- Because indentation requires tracking the element stack, the formatter knows which elements were never closed and which closing tags had no opener. Both are listed as warnings, an unclosed <div> is a frequent cause of content appearing in the wrong container.
- Void elements need no closing tag
- Elements like <br>, <img>, <input> and <meta> cannot have children, so they never open a new indentation level. The trailing slash in <br /> is XHTML style and optional in HTML5; both forms are accepted.
- Attributes are tidied but not reordered
- Whitespace within a tag is collapsed to single spaces, while quoted attribute values are left exactly as written. Attribute order is preserved, since it can matter for readability and for some framework directives.
- Formatting is not validation
- The formatter will happily indent markup that is invalid HTML, such as a <div> inside a <p> or a table with misplaced rows. It reports tag balance only. Use the W3C validator for conformance checking.