Uh oh!
There was an error while loading. Please reload this page.
fix: treat mailto/tel as external markdown links - #2976
Open
Steve0x2a wants to merge 1 commit into
Open
Conversation
Signed-off-by: Yi Zhan <stevesough@gmail.com>
✅ Deploy Preview for stoplight-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stoplight-elements-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 freeto 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
Contact email links in Additional Information (
[Contact …](mailto:…)) were classified as in-app routes.ReactRouterMarkdownLinkonly treated a URL as external when it contained://, so scheme-only URLs such asmailto:andtel: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 staymailto:/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:…">withtarget="_blank"