Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed table rendering (html and gfm) and reorganised mdx plugins #6039

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

ovflowd
Copy link
Member

@ovflowd ovflowd commented Oct 24, 2023

Description

This PR fixes HTML tables and GFM (GitHub Flavoured Markdown) tables not rendering. It adds support to:

  • GitHub Flavoured Markdown Tables (raw Markdown) (version 1.0.7 of the plugin, as 2.0.0 crashes next-mdx-remote) through a MDast Plugin (mdast-util-gfm-table)
  • HTML Tables for plain Markdown (as MDX already parses "HTML" (actually JSX) tables) through a Rehype Plugin (rehype-raw)
    • This plugin should only be used with plain Markdown as MDX already uses it, and otherwise it creates conflicts.

This PR segments all the MDX Plugins into a dedicated file next.mdx.js to keep the next.dynamic.mjs file clean.

Validation

All MDX/Markdown features should still be working as:

  • Headings having IDs
  • Headings having Anchor Tags
  • Raw Links becoming Anchor Tags
  • HTML tables being rendered
  • Codeboxes still work correctly

Related Issues

Closes #6002

@ovflowd ovflowd requested review from a team as code owners October 24, 2023 11:37
@vercel
Copy link

vercel bot commented Oct 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2023 1:56pm

@github-actions
Copy link

github-actions bot commented Oct 24, 2023

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 94%
94.61% (281/297) 76.81% (53/69) 93.33% (56/60)

Unit Test Report

Tests Skipped Failures Errors Time
29 0 💤 0 ❌ 0 🔥 5.599s ⏱️

Copy link
Contributor

@rodion-arr rodion-arr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next.mdx.mjs Outdated Show resolved Hide resolved
Signed-off-by: Claudio W <[email protected]>
@ovflowd
Copy link
Member Author

ovflowd commented Oct 24, 2023

Hey @nodejs/nodejs-website I'm fast-tracking this due to being an existing bug and this being a "hot fix"

@ovflowd ovflowd added this pull request to the merge queue Oct 24, 2023
Merged via the queue into main with commit 554086a Oct 24, 2023
14 checks passed
@ovflowd ovflowd deleted the fix/tables-and-reorganised-mdx-plugins branch October 24, 2023 14:03
@ovflowd ovflowd added the fast-track Fast Tracking PRs label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast-track Fast Tracking PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table is not rendered
2 participants