Repository navigation
Conversation
…ck extension point Mirror the markdown block parser/renderer pattern for the HTML format: a parser sees every RcDom element before built-in tag handling and claims it as a BlockNode::Custom; renderers share the name-keyed registry with markdown custom blocks. Html documents re-parse when html block parsers change (render-handle refreshes remain no-op via ptr_eq comparison). End-to-end test: parser claims <div data-mb>, renderer draws a marker, typed data survives.
…tensions pre-seeds the initial parse Render methods rebuild equivalent parser closures every frame — a ptr_eq comparison would force a re-parse per frame. Mirrors the markdown block-parser shape check (length-only). html_with_extensions registers extensions before the initial parse so custom HTML block parsers apply to the first parse without an element-driven re-parse (no first-frame flash).
|
❌ Changes requested: the use case is reasonable, but the reparse check reparses HTML on every render, and the public API surface should be smaller. Reviewed SHA: Findings
Ran
|
|
❌ The per-render reparse is fixed, but the other points from the last review are still open. Reviewed at fa3ef2e (delta from c29c7fb).
|
Incorporate the existing command rendering and other CI fixes without changing the extension API. Agent: rust-maintainer
|
Merged current main in Linux validation: check passes for Base, Component and Shell; all 465 Base text tests and all 124 Shell integration tests pass, including the previously failing |
Summary
Mirrors the existing Markdown block parser/renderer pattern for the HTML format:
TextView::html_block_parser— a parser sees every RcDom element before built-in tag handling; returning aMarkdownNodeclaims the element as aBlockNode::Custom,Nonefalls through to built-in handling.TextView::html_block_renderer— registers a renderer by node name; custom HTML blocks share the name-keyed registry (andBlockStateselection/copy plumbing) with custom Markdown blocks.Arc::ptr_eqcomparison).Motivation
HTML email (and similar rich-HTML sources) needs blocks the built-in HTML model does not cover (e.g. tables with
colspan/rowspan). The markdown side already solves this withmarkdown_block_parser/markdown_block_renderer; this gives HTML sources the same extension path without touching built-in rendering.Testing
html_block_parser_claims_elements_before_builtin_handling: parser claims<div data-mb>, renderer draws a marker, typed payload survives (node.data::<usize>()).gpui-basesuite passes (1735 tests) — the hook is inert unless a parser is registered.