Repository navigation
Refuse a message the HTML parser repairs for the repair alone, before drawing it - #6312
Merged
Merged
Conversation
… drawing it
A widget whose opening tag shares its line with its content, such as
`<lf-code id="x"><pre>…</pre></lf-code>`, is inline HTML by CommonMark's
rules, so Markdown draws a paragraph around it and the `<pre>` closes that
paragraph along with the widget. The agent then got a browser stack trace
("<lf-code> has no data body") from the draw check, which ran before the
markup gate; with the draw skipped, the gate added a `data-body` finding about
the widget the repair emptied.
Now the draw check leaves markup the parser repairs to the markup gate, and
the gate's fragment stage reports a repair's findings alone, as its stages
already do for every later check. The refusal shows the HTML Markdown drew,
`<p><lf-code …><pre>`, and "unclosed tags: <lf-code>".
CommonMark starts a block of HTML at a custom tag only when the tag is alone on
its line, since a parser can't tell whether a custom element is block or
inline (jgm in commonmark/commonmark-spec#758 and #239; #770, which would
make hyphenated tags block-level, is open). GitHub and markdown-it follow it,
as Leaf's readers do. Questions are a `<section role="group">` or
`<fieldset>` since #6256, which CommonMark reads as a block on one line.
leaf-agent
approved these changes
Nov 17, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 18, 2026
…e panel's stop (#6353) A click on empty space or words in an open tab panel focused the panel, because its `tabindex=0` makes it click-focusable. `c` then commented on the whole tab ("Comment on tab · #6312 …"), and no ring showed it. Now the press lands where it would without the panel's stop: on the nearest other focusable box around the panel, or nowhere. So `c` gives "Comment on the page", as it does on a plain page. Tabbing onto the panel still puts the user on it. Worth weighing: - DOM focus stays on the panel until the release, because Chromium ends a drag's selection when focus moves mid-drag. Until then, `focused()`, holds and the focus paint read where the press will land. - A tap's focus arrives at its click, so it passes a task later; otherwise Chromium drops the caret. - WebKit drops a collapsed caret on blur, so the caret is put back. - The stop that reach.js lends an overflowing box keeps its press focus, because a click on a diff's or a code block's scrollport is what puts the user in that widget's keys. So a click on a wide table still makes `c` comment on the table, at widths where the table overflows. Max asked for this on a Leaf page. Codex and a fresh Claude Code agent each reviewed it. Tests: - New `focus.test.mjs` cases cover each route. - 418 focused browser tests pass. - `leaf-dev probe`, base against head: Chromium, Firefox and WebKit, plus Chromium touch. > _This was written by Claude Code on behalf of max-sixty_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An agent's message whose widget opens on the same line as its content, such as
<lf-code id="x"><pre>…</pre></lf-code>, is refused for what CommonMark does to it, and only that. CommonMark reads a custom tag sharing its line as inline HTML, so Markdown draws a paragraph around it and the<pre>closes that paragraph along with the widget. Before, the agent got a browser stack trace (<lf-code> has no data body) from the draw check, which runs before the markup gate. Now the draw check leaves markup the HTML parser repairs to the gate, and the gate's fragment stage reports a repair's findings alone, as its later stages already do. The refusal reads:Max asked what the standard handling is for widgets written on one line (open item #8 from #6247). It's what Leaf's readers already do: a parser can't tell whether a custom element is block or inline, so CommonMark starts a block of HTML at one only when its tag is alone on its line (jgm in commonmark/commonmark-spec#758 and commonmark/commonmark-spec#239; commonmark/commonmark-spec#770, which would make hyphenated tags block-level, is still open). GitHub and markdown-it follow that. VitePress departs from it by treating every tag missing from a list of inline tags as block-level. Since #6256 a question is a
<section role="group">or<fieldset>, which CommonMark reads as a block even on one line, so this rule now matters only for a data widget written on one line.Ran the model and process tests around message markup, and the journey test for a widget that fails to draw.