From 4a9695ffbf7afb0cabb61d4406dc5520a1588f3a Mon Sep 17 00:00:00 2001 From: Rogee Date: Fri, 27 Sep 2024 18:12:28 +0800 Subject: [PATCH] fix: link color issues --- frontend/src/components/MediaContent.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/MediaContent.vue b/frontend/src/components/MediaContent.vue index 8151dbf..8a37124 100644 --- a/frontend/src/components/MediaContent.vue +++ b/frontend/src/components/MediaContent.vue @@ -18,27 +18,27 @@ export default defineComponent({ }; const nl2br = function (content) { - var breakTag = typeof is_xhtml === "undefined" ? "
" : "
"; + var breakTag = "
"; return (content + "").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1" + breakTag + "$2"); } const replaceTags = (content) => { - content = content.replace(/#(\S+)/g, '#$1'); + content = content.replace(/#(\S+)/g, '#$1'); return content; } const replaceLinks = (content) => { - content = content.replace(/(https?:\/\/\S+)/g, '$1'); + content = content.replace(/(https?:\/\/\S+)/g, '$1'); return content; } const processedContent = computed(() => { let content = props.content.trim(); - content = nl2br(content, false); content = replaceTags(content) content = replaceLinks(content) + content = nl2br(content); return content; }); @@ -51,3 +51,9 @@ export default defineComponent({ }, }); + +