fix: do not render headings with no content - #944
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@moshams272 is attempting to deploy a commit to the OpenJS Foundation Team on Vercel. A member of the Team first needs to authorize it. |
PR SummaryLow Risk Overview
The spec now treats the depth-1 title as OPTIONAL, RECOMMENDED instead of REQUIRED, and depth-1 semantics use SHOULD rather than MUST for “exactly one” heading. Reviewed by Cursor Bugbot for commit 66b522f. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #944 +/- ##
==========================================
- Coverage 89.57% 89.56% -0.02%
==========================================
Files 203 202 -1
Lines 19126 18997 -129
Branches 1791 1773 -18
==========================================
- Hits 17132 17014 -118
+ Misses 1986 1975 -11
Partials 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a0c54a2. Configure here.
|
Can you:
|
you mean for headings only, right? |
|
yes sorry |
a0c54a2 to
bee146c
Compare
|
this feels very related to notions within #931 |
Sort of, yes. We have one page without a heading, since we add the heading via JSX |
|
Could u tell me what the Vercel problem is 😅 |
No idea, seems just authorization issue. Probably because needs rebase. @moshams272 could you rebase please? |
66b522f to
114b02d
Compare
|
| File | Main | PR | Change |
|---|---|---|---|
orama-db.json |
9.14 MB | 9.14 MB | -1.00 B (-0.0%) |
Performance estimate (single CI run)
- Generation time: 1.7% faster (8.76 s → 8.61 s)
- Peak memory: 4.9% lower (1.91 GB → 1.82 GB)
web Generator
Output size: 1 file changed · net -208.00 B
File size details
| File | Main | PR | Change |
|---|---|---|---|
all.html |
31.74 MB | 31.74 MB | -208.00 B (-0.0%) |
Performance estimate (single CI run)
- Generation time: 1.9% faster (86.68 s → 84.99 s)
- Peak memory: 9.8% higher (4.81 GB → 5.29 GB)
Github things, I thought the deploy failed :) |

Description
Currently, if an MDX page lacks an ATX H1 (e.g., when the
h1is built into a custom React component),doc-kitautomatically injects an emptyh1to satisfy AST structural requirements and metadata generation.However, this leads to an issue for MDX: if it renders its own custom
h1in a React component, the final HTML ends up with twoh1tags (one fromdoc-kit, one from the component), breaking SEO and Accessibility.The current workaround involves forcing a
# Headingin markdown and visually hiding it via CSS (sr-only), which is a hack.This PR still injects an empty
h1, but it doesn't render the empty headings in general to DOM.Validation
Tested on
webpack-doc-kit:Before:

After:

Related Issues
None
Check List
node --run testand all tests passed.node --run format&node --run lint.