docs: fix MDX parse crashes that broke mint broken-links repo-wide#403
Merged
Conversation
Two pages aborted the mint broken-links crawler (it stops at the first unparseable file, so no page could be link-checked): - developer/error-codes.mdx: `%s`/`%w` in `###` headings → URIError when Mintlify percent-decodes the generated heading anchor. Backticks don't help (the slug still contains the bare `%`), so the headings now use plain titles and the literal error strings moved into inline code in the body. - rap/cel-expressions/env-user-attribute.md: bare `list<string>` in a table cell parsed as an unclosed JSX tag → wrapped in backticks, matching the repo-wide convention for angle-bracket types and placeholders. With these fixed, mint broken-links runs to completion and can link-check the whole repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes two documentation source constructs that caused Mintlify’s MDX parser to crash, which in turn prevented mint broken-links from running repository-wide. The updates make the affected pages parseable so the link checker can complete successfully, without changing any product/runtime behavior.
Changes:
- Updated four headings in
developer/error-codes.mdxto remove%format verbs (to prevent slug percent-decoding crashes) and preserved the exact error strings in an “Error message” line beneath each heading. - Wrapped
list<string>in inline code inrap/cel-expressions/env-user-attribute.mdto prevent MDX/JSX parsing issues in a table cell.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| rap/cel-expressions/env-user-attribute.md | Wrapes the angle-bracket generic type in inline code to avoid MDX parsing failures in table content. |
| developer/error-codes.mdx | Removes % verbs from headings (slug-safe) while retaining the literal error strings in body text for searchability and accuracy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Match the surrounding **Cause:**/**Solution:** label style. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two documentation pages whose source could not be parsed, which crashed the
mint broken-linkslink checker for the entire repository. After this change the checker parses every page and runs to completion.Docs-only change. No product, runtime, or API behavior is affected.
Problem
mint broken-links(and the Mintlify parser generally) aborts on the first file it cannot parse — it does not skip and continue. Two pages each contained a construct the MDX parser rejects, so the crawler died before it could link-check any page:developer/error-codes.mdx— four###headings contained raw printf-style format verbs (%s,%w), e.g.### Action %s not found. Mintlify percent-decodes the anchor slug it generates from each heading;%s/%ware not valid percent-escapes, so it throwsURIError: URI malformedat parse time.rap/cel-expressions/env-user-attribute.md— a table cell contained a barelist<string>. MDX reads<string>as the start of a JSX element and fails on the unclosed tag.Root cause / why the obvious fix doesn't work
For the headings, wrapping the verb in backticks is not sufficient — Mintlify strips the backticks but still keeps the bare
%in the generated slug, so the percent-decode still throws. The%has to leave the heading text entirely.Changes
error-codes.mdx: the four affected headings become plain, slug-safe titles (Action not found,Validate failed,Age: failed to encrypt,Age: failed to decrypt), and the exact literal error string moves into anError message:inline-code line directly beneath each heading. The verbatim string (with%s/%w) is preserved for search — inline code in body text is not slugified, so it does not crash.env-user-attribute.md:list<string>wrapped in backticks (inline code).Two files touched; no other pages changed.
Convention this documents
Format verbs (
%s,%w, …) and angle-bracket types or placeholders (<string>,<version>, …) must always appear in inline code or a code fence — never bare in prose, table cells, or headings. Headings have the extra constraint that they must not contain a bare%at all (even in backticks), because the anchor slug is percent-decoded. This matches how the rest of the repo already writes these.Pros
mint broken-linksrepo-wide — before this change no page could be link-checked locally; the tool crashed immediately. It now completes and surfaces real broken links.Cons / trade-offs
Risks & impact
#action-not-found). Any deep link to the old%-containing anchors would need updating — but those anchors were on a page the parser couldn't process, so working deep links to them are unlikely to exist. No other page's anchors change.mint broken-linkstool usable and does not alter CI behavior.Out of scope (pre-existing, revealed now that the checker runs)
With the parser unblocked,
mint broken-linksnow reports genuine broken links previously hidden behind the crash — e.g. missing BambooHR image assets, and/docs/-prefixed internal links insendgrid.mdx/index.mdx(the double-prefix that 404s). These are separate content issues in unrelated files and are not addressed here; worth a follow-up.🤖 Generated with Claude Code