Skip to content

docs: fix MDX parse crashes that broke mint broken-links repo-wide#403

Merged
mindymo merged 2 commits into
mainfrom
leet/docs-fix-mdx-parse-blockers
Jul 17, 2026
Merged

docs: fix MDX parse crashes that broke mint broken-links repo-wide#403
mindymo merged 2 commits into
mainfrom
leet/docs-fix-mdx-parse-blockers

Conversation

@leet-c1

@leet-c1 leet-c1 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes two documentation pages whose source could not be parsed, which crashed the mint broken-links link 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/%w are not valid percent-escapes, so it throws URIError: URI malformed at parse time.
  • rap/cel-expressions/env-user-attribute.md — a table cell contained a bare list<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 an Error 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

  • Unblocks mint broken-links repo-wide — before this change no page could be link-checked locally; the tool crashed immediately. It now completes and surfaces real broken links.
  • Aligns with the existing repo convention (backticked types/placeholders); no new pattern invented.
  • No content lost — the literal error strings remain on the page, verbatim, in code, and stay searchable.

Cons / trade-offs

  • The four error-code headings now read as short titles rather than the full literal error string; the exact string is one line lower (in the body). Minor cosmetic change to that one reference page.

Risks & impact

  • Anchor changes (low): the four headings' anchor slugs change (e.g. to #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.
  • No functional/product impact: documentation source only.
  • CI: the hosted Mintlify validation was already passing (it tolerates these files differently than the local CLI); this change makes the local mint broken-links tool usable and does not alter CI behavior.
  • Blast radius: limited to the two edited files.

Out of scope (pre-existing, revealed now that the checker runs)

With the parser unblocked, mint broken-links now reports genuine broken links previously hidden behind the crash — e.g. missing BambooHR image assets, and /docs/-prefixed internal links in sendgrid.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

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>
@mintlify

mintlify Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
conductorone 🟢 Ready View Preview Jul 17, 2026, 7:16 PM

@mintlify

mintlify Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
conductorone 🟡 Building Jul 17, 2026, 7:15 PM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.mdx to 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 in rap/cel-expressions/env-user-attribute.md to 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.

Comment thread developer/error-codes.mdx Outdated
Comment thread developer/error-codes.mdx Outdated
Comment thread developer/error-codes.mdx Outdated
Comment thread developer/error-codes.mdx Outdated
Match the surrounding **Cause:**/**Solution:** label style.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mindymo
mindymo merged commit 5851b66 into main Jul 17, 2026
3 checks passed
@mindymo
mindymo deleted the leet/docs-fix-mdx-parse-blockers branch July 17, 2026 20:58
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.

3 participants