Skip to content

fix(mdxish): render footnote refs in table#1494

Open
maximilianfalco wants to merge 3 commits into
nextfrom
falco/rm-16727-footnotes-not-rendering-in-tables
Open

fix(mdxish): render footnote refs in table#1494
maximilianfalco wants to merge 3 commits into
nextfrom
falco/rm-16727-footnotes-not-rendering-in-tables

Conversation

@maximilianfalco

@maximilianfalco maximilianfalco commented May 29, 2026

Copy link
Copy Markdown
Contributor
🎫 Resolve RM-16727

🎯 What does this PR do?

[^1] inside <Table> / <table> cells rendered as literal text and produced no footnote section. mdxishTables re-parses each table block through an isolated processor, and remark-gfm only tokenizes a footnote reference when the matching definition lives in the same parse context, so cell text stayed literal, and with no references emitted the outer document's definition was orphaned and remark-rehype dropped the <section>.

The fix collects every footnote id from the outer tree once and primes the table and cell re-parses with synthetic [^id]: x placeholders so refs tokenize correctly; the synthetic definitions are then stripped from the cell scope so only the real outer-document definition reaches the renderer.

🧪 QA tips

Verify that both tables render footnotes correctly

<Table>
  <thead>
    <tr><th>Term</th><th>Definition</th></tr>
  </thead>
  <tbody>
    <tr>
      <td>Example[^1]</td>
      <td>See footnote</td>
    </tr>
  </tbody>
</Table>

[^1]: This footnote should render.

| Term         | Definition    |
| ------------ | ------------- |
| Example[^1]  | See footnote  |

[^1]: This footnote should render.

📸 Screenshot or Loom

Before After
Screenshot 2026-05-29 at 13 28 06 Screenshot 2026-05-29 at 13 27 50

verified it works in the monorepo as well
Screenshot 2026-05-29 at 13 43 52

@gkoberger gkoberger force-pushed the falco/rm-16727-footnotes-not-rendering-in-tables branch from 005ad5e to 2843a71 Compare June 7, 2026 00:20
@gkoberger gkoberger requested a review from a team June 7, 2026 00:20
@jboyens jboyens force-pushed the falco/rm-16727-footnotes-not-rendering-in-tables branch from 2843a71 to 005ad5e Compare June 8, 2026 18:00
@erunion erunion requested review from a team and removed request for a team June 16, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant