Skip to content

fix(website): render GFM tables in .mdx pages - #1447

Open
Cedric Vidal (cedricvidal) wants to merge 2 commits into
microsoft:mainfrom
cedricvidal:fix/mdx-gfm-tables
Open

Cedric Vidal (cedricvidal) wants to merge 2 commits into
microsoft:mainfrom
cedricvidal:fix/mdx-gfm-tables

Conversation

@cedricvidal

Copy link
Copy Markdown
Contributor

Problem

Every table in a .mdx documentation page renders as literal pipe characters. Five published guides are affected, showing readers raw | Type | When to use | text where a table should be:

Guide Table rows affected
guides/importing-skills 21
guides/importing-mcp-servers 18
guides/defining-profiles 10
guides/importing-extensions 7
guides/managing-task-prompts 7

Cause

Astro applies its built-in GFM support to .md only. MDX inherits the configured remarkPlugins — the HTTP snippet plugin demonstrably runs on .mdx pages — but not that built-in, so tables are never parsed there. Listing remark-gfm explicitly restores them.

Why not just rename the pages to .md

That was the smaller change and it is wrong. Those five pages are exactly the ones that also use ```http fences, which remark-http-snippets turns into a Starlight <Tabs> group. That JSX renders only in .mdx, so renaming trades broken tables for broken tabs.

Verified both ways with a minimal page containing a table and an http fence:

table HTTP tabs
.md renders missing
.mdx before missing renders
.mdx after renders renders

Verification

All five guides now render tables and keep their tabs, and no page on the site is left with a literal-pipe paragraph:

Guide <tr> tabs literal pipes
defining-profiles 9 11 0
importing-extensions 6 23 0
importing-mcp-servers 16 31 0
importing-skills 17 15 0
managing-task-prompts 6 23 0

Site-wide after the change: 0 pages with unparsed tables, 203 pages built, pnpm test green.

Dependency note

remark-gfm@4.0.1 was already resolved in the lockfile as a transitive dependency, so this promotes it to a direct one. The lockfile change is three lines and adds no new packages.

Every table in a .mdx guide currently renders as literal pipe characters.
Five published pages are affected — importing-skills, importing-mcp-servers,
defining-profiles, importing-extensions and managing-task-prompts — showing
readers raw "| Type | When to use |" text instead of a table.

Astro applies its built-in GFM support to .md only. MDX inherits the
configured `remarkPlugins` — the HTTP snippet plugin demonstrably runs on
.mdx pages — but not that built-in, so tables are never parsed there.
Listing remark-gfm explicitly restores them.

Renaming the affected pages to .md would have been the smaller change, and
is wrong: those five are exactly the pages that also use ```http fences,
which the snippet plugin turns into a Starlight <Tabs> group. That JSX only
renders in .mdx, so the rename trades broken tables for broken tabs.
Verified both ways before choosing: in .md a table renders and the tabs
vanish; in .mdx with this fix, both render.

remark-gfm was already resolved in the lockfile as a transitive dependency,
so this promotes it to a direct one and adds no new packages.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 507f8ebd-cc32-489c-afca-8941c5f8dba1
@cmaneu

Copy link
Copy Markdown
Member

Cedric Vidal (@cedricvidal) is it a duplicate of my own #1429?

@manekinekko Wassim Chegham (manekinekko) added the type: documentation Documentation additions, corrections, and improvements. label Sep 30, 2026

This branch has not been deployed

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

Labels

type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants