Skip to content

finding(docs): four field pages need a blank line after SchemaExample so console's react-markdown renderer emits ## Field Schema (split from objectui#7666) #9427

Description

@os-tesla

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:

  1. 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.
  2. @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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions