From a7a50af896350e80cd23319b76df397174aa45d2 Mon Sep 17 00:00:00 2001 From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:38:19 +0200 Subject: [PATCH] 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 * css fix * fix linting --------- Co-authored-by: Ulf Gebhardt --- .../ItemPopupComponents/TextView.tsx | 7 + src/assets/css/leaflet.css | 165 +++++++++--------- 2 files changed, 92 insertions(+), 80 deletions(-) diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx index fee7109b..8936a19a 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx @@ -53,6 +53,13 @@ export const TextView = ({ if (innerText) replacedText = fixUrls(innerText) + if (replacedText) { + replacedText = replacedText.replace( + /(?)/g, + (url) => `[${url.replace(/https?:\/\/w{3}\./gi, '')}](${url})`, + ) + } + if (replacedText) { replacedText = replacedText.replace(mailRegex, (url) => { return `[${url}](mailto:${url})` diff --git a/src/assets/css/leaflet.css b/src/assets/css/leaflet.css index ede0d425..d8fab67f 100644 --- a/src/assets/css/leaflet.css +++ b/src/assets/css/leaflet.css @@ -1,98 +1,103 @@ .leaflet-control-attribution { - display: none; -} + display: none; + } -.leaflet-control-locate { - display: none; -} + .leaflet-control-locate { + display: none; + } -.leaflet-data-marker { - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAQCAYAAACcN8ZaAAAB3klEQVR42s3U4UdDURzG8czMXJnJ1Vwzc6VJZjaZJdlMlpQsKdmUFNOUspRSSqUolfQfr+fF98Vx5mwv9qbDx7LdznnO7/7Omej3+/+Ga0QMUYkhbvBgmhzCQxwxibIGrGEF8CQhU+LLtKQkQNqScUgjxRxTBIxbgfgD/BgnhM8kM5KTeclLQYqGkkMRBckzR8ic/mAgd5BAZplsUaqyIg2sDtHg2brUZJk5SmwopErJUWE8SpmTMhNvya60Zd/SNrR4bkeaskG4uiwRZk6yrJEYFibGAxn+scECHTmTnuVCzvmty3PHciB7bGKN6lQkzysPqIrHmpFhYbKUtckC1/Ioz4ZHuZdbuSLYiRxRpSZVWXZVxAzC0R4Ik5SQsu6w8yd5l2/5kg95I9SdXMoZQfYIUjeqEUrgOkXGPeN4TYRhxy8E+ZUf+eS7B7miIoeybVSjKDnm8u3+gH3pDTYwu1igATvs/pXqvBKiR4i2bNJfi1ZfUAnjgrOG8wY2quNzBKuU/ZS+uSFEl5O0xRGuUIlZCcw7xG5QPkeHYUSNV5WXGou2sC3rBC0LjenqCXGO0WEiTJa0Lr4KixdHBrDGuGGiRqCUpFk8pGIpQtCU7p4YPwxYxEMCk1aAMQZh8Ac8PfbIzYPJOwAAAABJRU5ErkJggg==') no-repeat; - background-position: 6px 32px; -} + .leaflet-data-marker { + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAQCAYAAACcN8ZaAAAB3klEQVR42s3U4UdDURzG8czMXJnJ1Vwzc6VJZjaZJdlMlpQsKdmUFNOUspRSSqUolfQfr+fF98Vx5mwv9qbDx7LdznnO7/7Omej3+/+Ga0QMUYkhbvBgmhzCQxwxibIGrGEF8CQhU+LLtKQkQNqScUgjxRxTBIxbgfgD/BgnhM8kM5KTeclLQYqGkkMRBckzR8ic/mAgd5BAZplsUaqyIg2sDtHg2brUZJk5SmwopErJUWE8SpmTMhNvya60Zd/SNrR4bkeaskG4uiwRZk6yrJEYFibGAxn+scECHTmTnuVCzvmty3PHciB7bGKN6lQkzysPqIrHmpFhYbKUtckC1/Ioz4ZHuZdbuSLYiRxRpSZVWXZVxAzC0R4Ik5SQsu6w8yd5l2/5kg95I9SdXMoZQfYIUjeqEUrgOkXGPeN4TYRhxy8E+ZUf+eS7B7miIoeybVSjKDnm8u3+gH3pDTYwu1igATvs/pXqvBKiR4i2bNJfi1ZfUAnjgrOG8wY2quNzBKuU/ZS+uSFEl5O0xRGuUIlZCcw7xG5QPkeHYUSNV5WXGou2sC3rBC0LjenqCXGO0WEiTJa0Lr4KixdHBrDGuGGiRqCUpFk8pGIpQtCU7p4YPwxYxEMCk1aAMQZh8Ac8PfbIzYPJOwAAAABJRU5ErkJggg==') no-repeat; + background-position: 6px 32px; + } -.leaflet-container { - cursor: inherit; -} + .leaflet-container { + cursor: inherit; + } -.leaflet-popup-scrolled { - overflow-x: hidden; -} + .leaflet-popup-scrolled { + overflow-x: hidden; + } -.leaflet-popup-content-wrapper, .leaflet-popup-tip{ - background-color: var(--color-base-100); - color: var(--color-base-content); - border-radius: var(--radius-box); -} + .leaflet-popup-content-wrapper, + .leaflet-popup-tip { + background-color: var(--color-base-100); + color: var(--color-base-content); + border-radius: var(--radius-box); + } -.leaflet-popup-tip-container, .leaflet-popup-tip{ - border-radius: 0; -} + .leaflet-popup-tip-container, + .leaflet-popup-tip { + border-radius: 0; + } -.leaflet-tooltip { - background-color: var(--color-base-100); - color: var(--color-base-content); - border-width: 0px; -} + .leaflet-tooltip { + background-color: var(--color-base-100); + color: var(--color-base-content); + border-width: 0px; + } -.leaflet-tooltip { - border-radius: var(--radius-box); - transition: opacity 500ms; - transition-delay: 50ms; -} + .leaflet-tooltip { + border-radius: var(--radius-box); + transition: opacity 500ms; + transition-delay: 50ms; + } -.leaflet-tooltip::before { - border-top-color: var(--color-base-100); -} + .leaflet-tooltip::before { + border-top-color: var(--color-base-100); + } -.leaflet-container { - text-align: left; - background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E"); - background-repeat: no-repeat; - background-attachment: fixed; - background-position: 50% 80%; -} + .leaflet-container { + text-align: left; + background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E"); + background-repeat: no-repeat; + background-attachment: fixed; + background-position: 50% 80%; + } -.leaflet-popup-close-button span { - color: var(--color-base-content); - opacity: 50%; -} + .leaflet-popup-close-button span { + color: var(--color-base-content); + opacity: 50%; + } -.leaflet-top { - top: 6em -} + .leaflet-top { + top: 6em + } -.leaflet-left { - left: 0.5em -} + .leaflet-left { + left: 0.5em + } -.leaflet-control-zoom { - border-radius: var(--radius-box); - color: var(--color-base-content); - background-color: var(--color-base-100); - width: calc(var(--tw-spacing) * 10); - border: 2px solid var(--color-base-300) !important; - box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important; -} + .leaflet-control-zoom { + border-radius: var(--radius-box); + color: var(--color-base-content); + background-color: var(--color-base-100); + width: calc(var(--tw-spacing) * 10); + border: 2px solid var(--color-base-300) !important; + box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important; + } -.leaflet-control-zoom-in { - border-top-left-radius: var(--radius-box) !important; - border-top-right-radius: var(--radius-box) !important; - color: var(--color-base-content) !important; - background-color: var(--color-base-100) !important; - width: calc(var(--tw-spacing) * 9) !important; - border-bottom: 1px solid var(--color-base-300) !important; - height: calc(var(--tw-spacing) * 9) !important; - line-height: 40px !important; -} + .leaflet-control-zoom-in { + border-top-left-radius: var(--radius-box) !important; + border-top-right-radius: var(--radius-box) !important; + color: var(--color-base-content) !important; + background-color: var(--color-base-100) !important; + width: calc(var(--tw-spacing) * 9) !important; + border-bottom: 1px solid var(--color-base-300) !important; + height: calc(var(--tw-spacing) * 9) !important; + line-height: 40px !important; + } -.leaflet-control-zoom-out { - border-bottom-left-radius: var(--radius-box) !important; - border-bottom-right-radius: var(--radius-box) !important; - color: var(--color-base-content) !important; - background-color: var(--color-base-100) !important; - width: calc(var(--tw-spacing) * 9) !important; - height: calc(var(--tw-spacing) * 9) !important; - line-height: 40px !important; -} + .leaflet-control-zoom-out { + border-bottom-left-radius: var(--radius-box) !important; + border-bottom-right-radius: var(--radius-box) !important; + color: var(--color-base-content) !important; + background-color: var(--color-base-100) !important; + width: calc(var(--tw-spacing) * 9) !important; + height: calc(var(--tw-spacing) * 9) !important; + line-height: 40px !important; + } + .leaflet-popup-content p { + margin: calc(var(--tw-spacing) * 1) !important + } \ No newline at end of file