From markup to hierarchy
When markup is entered, the viewer constructs the hierarchy represented by its elements. Start tags introduce elements, end tags close applicable elements, and attributes remain attached to their owning element. If markup is incomplete or malformed, HTML parsing rules determine the recovered relationships. The displayed result is therefore a parsed tree, not a syntax-highlighted or byte-for-byte copy of the input.