From 233cbce772c01624bc77c58f246777e579ec079e Mon Sep 17 00:00:00 2001 From: biast12 <53872542+biast12@users.noreply.github.com> Date: Mon, 31 Aug 2026 22:35:50 +0200 Subject: [PATCH] Fix: Tag Message Content preview does not render Markdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tag editor's Message Content preview rendered the raw string, so `**bold**` showed literal asterisks — even though the bot posts that string to Discord as message content, where Discord does render it. The embed preview directly below it in the same modal already rendered correctly, so the modal contradicted itself. --- .../src/components/discord/DiscordEmbed.tsx | 25 +++++++++++------- .../src/components/modals/TagEditorModal.tsx | 26 ++++++++++++------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/discord/DiscordEmbed.tsx b/frontend/src/components/discord/DiscordEmbed.tsx index 807a6942..86979495 100644 --- a/frontend/src/components/discord/DiscordEmbed.tsx +++ b/frontend/src/components/discord/DiscordEmbed.tsx @@ -47,16 +47,19 @@ const DiscordEmbedComponent: FC = ({ embed, entities, classNa {embed.title && (
{embed.url && isSafeUrl(embed.url) ? ( - - {embed.title} + + ) : ( -

{embed.title}

+ )}
)} @@ -76,7 +79,11 @@ const DiscordEmbedComponent: FC = ({ embed, entities, classNa key={index} className={field.inline ? "inline-block mr-4 mb-2 min-w-37.5 max-w-50" : "mb-2"} > -
{field.name}
+ = ({ const linkedArticle = kbArticleId != null ? kbArticles?.find((a) => a.id === kbArticleId) : null; + const hasContentPreview = content.trim().length > 0; + const hasArticlePreview = !!linkedArticle?.content?.trim(); + const kbArticleOptions = (kbArticles ?? []) .filter((a) => a.published) .map((a) => ({ @@ -408,12 +412,13 @@ const TagEditorModal: FC = ({ {linkToKB && linkedArticle ? (

Showing linked KB article preview:

- {linkedArticle.content && ( -

- {linkedArticle.content} -

+ {hasArticlePreview && ( + )} - {!linkedArticle.content && ( + {!hasArticlePreview && (

Article has no text content (may use an embed).

@@ -421,13 +426,14 @@ const TagEditorModal: FC = ({
) : ( <> - {content && ( -

- {content} -

+ {hasContentPreview && ( + )} {useEmbed && } - {!content && !useEmbed && ( + {!hasContentPreview && !useEmbed && (

Add message content or enable an embed to see a preview.