From b3890a5eff29fc1c3038a7553453a204755c7256 Mon Sep 17 00:00:00 2001 From: Onion-L Date: Mon, 4 Nov 2024 10:36:11 +0800 Subject: [PATCH] fix: remove extra margins before tags --- composables/content-parse.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composables/content-parse.ts b/composables/content-parse.ts index f9b02b65..0fd66364 100644 --- a/composables/content-parse.ts +++ b/composables/content-parse.ts @@ -90,6 +90,11 @@ export function parseMastodonHTML( inReplyToStatus, } = options + // remove newline before Tags + html = html.replace(/\n(<[^>]+>)/g, (_1, raw) => { + return raw + }) + if (markdown) { // Handle code blocks html = html