fix(api-docs): strip empty HTML comments from markdown exports#17992
fix(api-docs): strip empty HTML comments from markdown exports#17992cvxluo wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
af13849 to
394a5f4
Compare
Two sources of noise leaked into the API .md exports, e.g. `* <!-- -->(<!-- -->string<!-- -->)*`: - React inserts empty `<!-- -->` separator comments between adjacent text nodes in server-rendered output (common on component-rendered pages like the API docs). Drop comment nodes in the HTML->markdown pipeline; comments dispatch by node type, so this lives in nodeHandlers, not handlers. - The parameter type was wrapped in an <em> with a leading space inside it, which remark encoded as ` `. Move the space outside the <em> so it serializes as a normal space. Also bump CACHE_VERSION, since cached entries are keyed on input HTML (not on this script) and would otherwise serve stale output after the logic change. Co-Authored-By: Claude <noreply@anthropic.com>
394a5f4 to
9d48e59
Compare
| <dt> | ||
| <div> | ||
| <code data-index>{param.name}</code> | ||
| <code data-index>{param.name}</code>{' '} |
There was a problem hiding this comment.
seems like this extra space in the <em> was getting rendered as  , so moving this lets us go from:
* status* <!-- -->(<!-- -->string<!-- -->)*
to
status(string)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9d48e59. Configure here.
| <code data-index>{param.name}</code>{' '} | ||
| {!!param.schema?.type && ( | ||
| <em> | ||
| {' '} |
There was a problem hiding this comment.
Unconditional trailing space when schema type is missing
Low Severity
The {' '} space after <code> is now rendered unconditionally, but it only makes sense as a separator when the <em> type annotation follows. Previously the space lived inside the conditional <em> block and was only emitted when param.schema?.type was truthy. If a parameter ever lacks a schema type at runtime (which the defensive optional chaining ?. suggests is possible), there will be a stray trailing space after the parameter name.
Reviewed by Cursor Bugbot for commit 9d48e59. Configure here.


Remove extra artifacts in the markdown version of the API docs. We were inserting extra comment markers (
<!-- -->) and spaces ( ) within the API docs.Before:
After:
DESCRIBE YOUR PR
Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES