Split from objectui#7666's cross-lane finding. That card fenced its dispatch to
packages/plugin-markdown/** only and named two possible landings —
extractToc (domain:ui) OR the four content/docs/fields/*.mdx pages
(domain:devx). Measurement below settles which one: this is the docs half,
content/docs/**, domain:devx. Filed as its own card per that fence rather
than edited into #7666, and objectui#7666 is left for triage to re-grade or
close — not done here.
What was measured
Four docs each place a self-closing SchemaExample JSX tag immediately
before ## Field Schema, with no blank line between them:
content/docs/fields/date.mdx
content/docs/fields/rich-text.mdx
content/docs/fields/text.mdx
content/docs/fields/textarea.mdx
Two real render pipelines disagree on what that produces:
packages/plugin-markdown's MarkdownImpl (react-markdown, the chain
apps/console's DocPage uses) follows CommonMark's HTML-block rule: an
HTML block only ends at a blank line, so the JSX tag's block swallows the
heading line — no field-schema id is ever emitted. Re-measured on the
real corpus today (223 files, 2981 rendered headings — up from the
2941 the original finding read on 2026-09-07, so the corpus moved, but the
divergence count is still exactly these same 4 files): confirmed reproduced
on all four, unchanged.
@mdx-js/mdx (the compiler fumadocs-mdx uses for apps/site) does
not swallow it: compiled in situ, all four files emit field-schema
in the expected position — date.mdx →
["basic-usage","with-default-value","field-schema","date-formats", …],
and the other three the same shape. A self-closing MDX JSX flow element
closes immediately; it isn't a CommonMark HTML block and doesn't wait for
a blank line the way one does.
So apps/site's rendering of these four pages is already correct, and
packages/plugin-markdown's extractToc already agrees with it (extractToc
has no apps/site consumer — its one real caller is apps/console's
DocPage.tsx, paired with MarkdownImpl). The renderer that disagrees
(MarkdownImpl) is the one following CommonMark correctly; the docs are the
ones authoring a shape it can't turn into a heading.
Confirmed the fix on the real file (date.mdx): inserting one blank line
between the SchemaExample tag and ## Field Schema makes MarkdownImpl
also emit field-schema, and extractToc's answer then matches the renderer
exactly. The same synthetic shape rendered through @mdx-js/mdx gives the
same field-schema id whether or not the blank line is present, so the
insertion costs apps/site nothing.
The fix
In each of the four files, add one blank line between the leading
SchemaExample tag and the ## Field Schema heading that follows it (the
same shape every other section boundary in these files already uses).
Why not fix extractToc instead
objectui#7666's own triage comment already priced this option and rejected
it: teaching extractToc the CommonMark HTML-block continuation rule would
fix the MarkdownImpl pairing but flip the divergence for any MDX consumer
— extractToc doesn't take a "which parser will render this" argument, and
the measurement above shows the two real pipelines in this monorepo already
disagree on this exact shape. That is a strictly worse contract than a
four-line docs patch, so packages/plugin-markdown needs no change for this
card.
Refs: objectui#7666
Split from objectui#7666's cross-lane finding. That card fenced its dispatch to
packages/plugin-markdown/**only and named two possible landings —extractToc(domain:ui) OR the fourcontent/docs/fields/*.mdxpages(domain:devx). Measurement below settles which one: this is the docs half,
content/docs/**, domain:devx. Filed as its own card per that fence ratherthan edited into #7666, and objectui#7666 is left for triage to re-grade or
close — not done here.
What was measured
Four docs each place a self-closing
SchemaExampleJSX tag immediatelybefore
## Field Schema, with no blank line between them:content/docs/fields/date.mdxcontent/docs/fields/rich-text.mdxcontent/docs/fields/text.mdxcontent/docs/fields/textarea.mdxTwo real render pipelines disagree on what that produces:
packages/plugin-markdown'sMarkdownImpl(react-markdown, the chainapps/console'sDocPageuses) follows CommonMark's HTML-block rule: anHTML block only ends at a blank line, so the JSX tag's block swallows the
heading line — no
field-schemaid is ever emitted. Re-measured on thereal corpus today (223 files, 2981 rendered headings — up from the
2941 the original finding read on 2026-09-07, so the corpus moved, but the
divergence count is still exactly these same 4 files): confirmed reproduced
on all four, unchanged.
@mdx-js/mdx(the compilerfumadocs-mdxuses forapps/site) doesnot swallow it: compiled in situ, all four files emit
field-schemain the expected position —
date.mdx→["basic-usage","with-default-value","field-schema","date-formats", …],and the other three the same shape. A self-closing MDX JSX flow element
closes immediately; it isn't a CommonMark HTML block and doesn't wait for
a blank line the way one does.
So
apps/site's rendering of these four pages is already correct, andpackages/plugin-markdown'sextractTocalready agrees with it (extractTochas no
apps/siteconsumer — its one real caller isapps/console'sDocPage.tsx, paired withMarkdownImpl). The renderer that disagrees(
MarkdownImpl) is the one following CommonMark correctly; the docs are theones authoring a shape it can't turn into a heading.
Confirmed the fix on the real file (
date.mdx): inserting one blank linebetween the
SchemaExampletag and## Field SchemamakesMarkdownImplalso emit
field-schema, andextractToc's answer then matches the rendererexactly. The same synthetic shape rendered through
@mdx-js/mdxgives thesame
field-schemaid whether or not the blank line is present, so theinsertion costs
apps/sitenothing.The fix
In each of the four files, add one blank line between the leading
SchemaExampletag and the## Field Schemaheading that follows it (thesame shape every other section boundary in these files already uses).
Why not fix
extractTocinsteadobjectui#7666's own triage comment already priced this option and rejected
it: teaching
extractTocthe CommonMark HTML-block continuation rule wouldfix the
MarkdownImplpairing but flip the divergence for any MDX consumer—
extractTocdoesn't take a "which parser will render this" argument, andthe measurement above shows the two real pipelines in this monorepo already
disagree on this exact shape. That is a strictly worse contract than a
four-line docs patch, so
packages/plugin-markdownneeds no change for thiscard.
Refs: objectui#7666