Skip to content

fix: treat mailto/tel as external markdown links - #2976

Open
Steve0x2a wants to merge 1 commit into
stoplightio:mainfrom
Steve0x2a:fix/mailto-external-links
Open

fix: treat mailto/tel as external markdown links#2976
Steve0x2a wants to merge 1 commit into
stoplightio:mainfrom
Steve0x2a:fix/mailto-external-links

Conversation

@Steve0x2a

Copy link
Copy Markdown

Summary

Contact email links in Additional Information ([Contact …](mailto:…)) were classified as in-app routes. ReactRouterMarkdownLink only treated a URL as external when it contained ://, so scheme-only URLs such as mailto: and tel: did not match and were not rendered as external anchors.

The external-link regex now matches RFC 3986 schemes (mailto:, tel:, https://, protocol-relative //, and similar), so those hrefs stay mailto: / tel: instead of being handled as in-app links.

Fixes#2670

Credit to @RanolP for the report and reproduction.

Test plan

  • yarn workspace @stoplight/elements-core test src/components/MarkdownViewer/CustomComponents/ReactRouterLink.spec.tsx — mailto href renders as <a href="mailto:…"> with target="_blank"
  • Related MarkdownViewer, Article, and HttpService unit tests
  • eslint on the changed files

Signed-off-by: Yi Zhan <stevesough@gmail.com>
@Steve0x2a
Steve0x2a requested a review from a team as a code ownerSeptember 6, 2026 17:46
@netlify

netlifyBot commented Sep 6, 2026

Copy link
Copy Markdown

Deploy Preview for stoplight-elements ready!

NameLink
🔨 Latest commit6b9f10e
🔍 Latest deploy loghttps://app.netlify.com/projects/stoplight-elements/deploys/6a9da6eb976eb90007c94634
😎 Deploy Previewhttps://deploy-preview-2976--stoplight-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlifyBot commented Sep 6, 2026

Copy link
Copy Markdown

Deploy Preview for stoplight-elements-demo ready!

NameLink
🔨 Latest commit6b9f10e
🔍 Latest deploy loghttps://app.netlify.com/projects/stoplight-elements-demo/deploys/6a9da6eb20a75700082e9c3a
😎 Deploy Previewhttps://deploy-preview-2976--stoplight-elements-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for freeto 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.

Bug: Contact email links to incorrect URL

1 participant

@Steve0x2a