diff --git a/components/base/BaseRte.vue b/components/base/BaseRte.vue index fff2858..3c01d40 100644 --- a/components/base/BaseRte.vue +++ b/components/base/BaseRte.vue @@ -14,11 +14,11 @@ if (alteredData !== null) { // find all links const linkRegex = /]*href=["']|(?!http:\/\/))(.*?)["'](.*?)>/g; - const links = alteredData.match(linkRegex); + const links = alteredData?.match(linkRegex); if (links) { links.forEach((link) => { - const hrefMatch = link.match(/href="([^"]*)"/); + const hrefMatch = link?.match(/href="([^"]*)"/); if (hrefMatch) { const href = hrefMatch[1]; if ( @@ -26,9 +26,9 @@ if (alteredData !== null) { eternalStrings.some((external) => href.includes(external)) ) { // the first character of the href is a /, so we need to remove that and add https:// to the href string - alteredData = alteredData.replace( + alteredData = alteredData?.replace( link, - link.replace(href, `https://${href}`), + link?.replace(href, `https://${href}`), ); } } @@ -36,7 +36,7 @@ if (alteredData !== null) { } // Correcting links, adding open in new tab, using title as link text - alteredData = alteredData.replace( + alteredData = alteredData?.replace( /]*href="([^"]*)"[^>]*title="([^"]*)"[^>]*>(.*?)<\/a>/g, (_, href, title, linkText) => { const shouldOpenInNewTab = /target="_blank"/i.test(_); @@ -56,6 +56,17 @@ if (alteredData !== null) { .base-rte { word-wrap: break-word; + :deep(a) { + color: var(--color-primary-darken-1); + text-decoration: none; + border-bottom: 1px solid transparent; + transition: border-bottom 0.3s ease-in-out; + + &:hover { + border-bottom: 1px solid var(--color-primary); + } + } + :deep(.text-align-right) { text-align: right; } diff --git a/components/blocks/RteBlock.vue b/components/blocks/RteBlock.vue index fbc9db3..d31777c 100644 --- a/components/blocks/RteBlock.vue +++ b/components/blocks/RteBlock.vue @@ -1,115 +1,14 @@ - -