Parsing
A formatted document may reflect browser repair rather than the author's original tree
Missing closing tags, invalid nesting, duplicate attributes, and stray table elements can be corrected or moved by an HTML parser. Compare the formatted tree with the intended semantics and run a standards validator. A clean indentation pattern does not prove that labels, landmarks, headings, forms, or interactive elements are valid.
Whitespace
Whitespace is insignificant in many places and meaningful in others
Text nodes, inline elements, pre, textarea, code samples, emails, templates, and script or style content can depend on spaces and line breaks. Minifying or cleaning may also remove comments used by build tools or conditional systems. Review rendered text and generated output around every whitespace-sensitive region.
Preview safety
Rendered previews must be treated as active markup, not plain text
Only preview HTML you trust, and keep sanitization enabled where offered. Scripts, event-handler attributes, embedded frames, forms, and dangerous URLs can execute or transmit data in a permissive preview. Formatting is not sanitization and should never be used as an XSS defense.