Skip to content
Snippets Groups Projects
Commit cd3d21c0 authored by Sameer Al-Sakran's avatar Sameer Al-Sakran Committed by GitHub
Browse files

Merge pull request #5957 from Hoodline/master

Wrap link URLs within map popups
parents b29151f7 f4204bea
Branches
Tags
No related merge requests found
......@@ -17,6 +17,9 @@
.link--nohover:hover {
text-decoration: none;
}
.link--wrappable {
word-break: break-all;
}
.expand-clickable {
display: inline-block;
......
......@@ -209,7 +209,7 @@ const URL_WHITELIST_REGEX = /^(https?|mailto):\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:
export function formatUrl(value: Value, { jsx }: FormattingOptions = {}) {
const url = String(value);
if (jsx && URL_WHITELIST_REGEX.test(url)) {
return <ExternalLink href={url}>{url}</ExternalLink>;
return <ExternalLink className="link link--wrappable" href={url}>{url}</ExternalLink>;
} else {
return url;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment