mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix(source): fix link detection (#243)
* 3.0.97 * 3.0.98 * 3.0.99 * fixed markdown link detection * Update src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de> * css fix * fix linting --------- Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
This commit is contained in:
parent
6327ae7788
commit
a7a50af896
@ -53,6 +53,13 @@ export const TextView = ({
|
|||||||
|
|
||||||
if (innerText) replacedText = fixUrls(innerText)
|
if (innerText) replacedText = fixUrls(innerText)
|
||||||
|
|
||||||
|
if (replacedText) {
|
||||||
|
replacedText = replacedText.replace(
|
||||||
|
/(?<!\]?\()(?<!<)https?:\/\/[^\s)]+(?!\))(?!>)/g,
|
||||||
|
(url) => `[${url.replace(/https?:\/\/w{3}\./gi, '')}](${url})`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (replacedText) {
|
if (replacedText) {
|
||||||
replacedText = replacedText.replace(mailRegex, (url) => {
|
replacedText = replacedText.replace(mailRegex, (url) => {
|
||||||
return `[${url}](mailto:${url})`
|
return `[${url}](mailto:${url})`
|
||||||
|
|||||||
@ -19,13 +19,15 @@
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-popup-content-wrapper, .leaflet-popup-tip{
|
.leaflet-popup-content-wrapper,
|
||||||
|
.leaflet-popup-tip {
|
||||||
background-color: var(--color-base-100);
|
background-color: var(--color-base-100);
|
||||||
color: var(--color-base-content);
|
color: var(--color-base-content);
|
||||||
border-radius: var(--radius-box);
|
border-radius: var(--radius-box);
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-popup-tip-container, .leaflet-popup-tip{
|
.leaflet-popup-tip-container,
|
||||||
|
.leaflet-popup-tip {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,3 +98,6 @@
|
|||||||
line-height: 40px !important;
|
line-height: 40px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-popup-content p {
|
||||||
|
margin: calc(var(--tw-spacing) * 1) !important
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user