Skip to content

fix(jsx-ast): preserve generated footnotes#797

Open
panva wants to merge 1 commit into
nodejs:mainfrom
panva:fix/jsx-footnotes-layout
Open

fix(jsx-ast): preserve generated footnotes#797
panva wants to merge 1 commit into
nodejs:mainfrom
panva:fix/jsx-footnotes-layout

Conversation

@panva
Copy link
Copy Markdown
Member

@panva panva commented May 17, 2026

before after
footnotes-before-crypto footnotes-after-crypto

@panva panva requested a review from a team as a code owner May 17, 2026 16:57
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Error Error May 18, 2026 5:02pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 17, 2026

PR Summary

Medium Risk
Moderate risk because it changes post-processing of the root AST structure, which can affect document rendering/order across different MDX trees, but it’s narrowly scoped and covered by a new unit test.

Overview
Ensures generated GFM footnotes aren’t dropped or inserted into a hard-coded subtree by detecting the footnotes <section> via dataFootnotes/footnotes class, removing it from the root, and appending it to the Layout node’s children (or back to root if no Layout exists).

Adds a focused unit test asserting that the transformer moves the footnotes section under Layout rather than leaving it at the root.

Reviewed by Cursor Bugbot for commit dcc2876. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 94.28571% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.85%. Comparing base (fb15e44) to head (dcc2876).

Files with missing lines Patch % Lines
src/generators/jsx-ast/utils/transformer.mjs 85.71% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #797      +/-   ##
==========================================
+ Coverage   82.82%   82.85%   +0.02%     
==========================================
  Files         169      170       +1     
  Lines       14670    14732      +62     
  Branches     1259     1266       +7     
==========================================
+ Hits        12151    12206      +55     
- Misses       2513     2520       +7     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants