Markdown links inside JSX components and OpenAPI descriptions are not rewritten on subpath deployments #5485
5kbpers
started this conversation in
Bugs & Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
On a
/docssubpath deployment (reverse proxy via Cloudflare Workers, per https://mintlify.com/docs/deploy/docs-subpath), Mintlify correctly rewrites sidebar navigation links and<Card href>attributes to include the subpath prefix, but does not rewrite markdown[text](/v2/foo)links that appear inside:<Tip>,<Note>,<Warning>,<Info>descriptionfields (operation descriptions, parameter descriptions, schema property descriptions)This produces dead links on every deployed page that uses those patterns.
Reproduction
Deploy any docs site at a
/docssubpath (e.g. Cloudflare Worker that proxiesexample.com/docs/*to Mintlify withX-Forwarded-Host).Create a page
foo.mdxwith both forms:Visit
example.com/docs/fooin production and inspect the rendered anchors:/docs/bar<Card href="/bar">/docs/bar<Tip>(markdown link)/bar<Tip>(HTML<a href="/bar">)/bar<Tip>with relative[Bar](bar)bar+target="_blank" rel="noreferrer"description: "See [Bar](/bar)"/barExpected behavior
All internal markdown links should receive the same subpath-aware rewriting regardless of whether they appear in a plain paragraph, inside a JSX component, or inside an OpenAPI
descriptionfield. Relative paths inside JSX components should not be flagged as external.Current workaround
Rewrite every affected link to a hardcoded absolute URL (
https://example.com/docs/bar). Downsides:mint devlocal preview — clicks leave the local server and jump to production.[text](/path)convention need to be rewritten.Environment
/docssubpath via Cloudflare Worker reverse proxy withX-Forwarded-Host, following the official subpath guide.mintCLI: latest<Tip>/<Note>/<Warning>for cross-references, and all pages backed by an OpenAPI spec with markdown links indescriptionfields.Suggested fix
Apply the subpath rewrite pass to the full MDX AST (including JSX component children) and to all markdown strings coming from the OpenAPI spec — not only to top-level markdown nodes and known navigation props.
Beta Was this translation helpful? Give feedback.
All reactions