Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 172d87e

Browse files
committed
Fall back to plain-text topic in catch
1 parent 27a040d commit 172d87e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/HtmlUtils.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ export function topicToHtml(topic: string, htmlTopic?: string, ref?: React.Ref<H
625625
htmlTopic = null;
626626
}
627627

628-
const isFormattedTopic = !!htmlTopic;
628+
let isFormattedTopic = !!htmlTopic;
629629
let topicHasEmoji = false;
630630
let safeTopic = "";
631631

@@ -638,7 +638,9 @@ export function topicToHtml(topic: string, htmlTopic?: string, ref?: React.Ref<H
638638
safeTopic = formatEmojis(safeTopic, true).join('');
639639
}
640640
}
641-
} catch {}
641+
} catch {
642+
isFormattedTopic = false; // Fall back to plain-text topic
643+
}
642644

643645
let emojiBodyElements: ReturnType<typeof formatEmojis>;
644646
if (!isFormattedTopic && topicHasEmoji) {

0 commit comments

Comments
 (0)