A small document
A paragraph with strong and emphasized text, a link and inline code.
First item
Second item
Each node type describes its own HTML once. The editable surface and the delivered page are both derived from that description, so they cannot drift apart.
HtmlSemantics describes a node without its children. The children belong to the UI runtime, so there is no second view tree to diff.
renderToHtml renders a Document once, without a session. RenderProfile.Content leaves every editor attribute out by construction; RenderProfile.Editor adds node IDs for the editable surface.
Rendered with RenderProfile.Content on every commit.
A paragraph with strong and emphasized text, a link and inline code.
First item
Second item
The real output also contains the UI runtime's group anchors, such as <!--ui:KeyedChildren:start-->. They are invisible, carry no meaning and let the browser claim the markup; the inspector above leaves them out.
The HTML says what is meant, and only a short list of attributes may appear in it.