diff --git a/web/app/components/app/in-site-message.tsx b/web/app/components/app/in-site-message.tsx index e9c8972fe6..1b7ac65ff7 100644 --- a/web/app/components/app/in-site-message.tsx +++ b/web/app/components/app/in-site-message.tsx @@ -24,6 +24,10 @@ type InSiteMessageProps = { title: string } +function normalizeLineBreaks(text: string): string { + return text.replace(/\\n/g, '\n') +} + function normalizeLinkData(data: unknown): { href: string, rel?: string, target?: string } | null { if (typeof data === 'string') return { href: data, target: '_blank' } @@ -51,6 +55,8 @@ function InSiteMessage({ title, }: InSiteMessageProps) { const [visible, setVisible] = useState(true) + const normalizedTitle = normalizeLineBreaks(title) + const normalizedSubtitle = normalizeLineBreaks(subtitle) const headerStyle = useMemo(() => { return { @@ -88,11 +94,11 @@ function InSiteMessage({ )} >
-
- {title} +
+ {normalizedTitle}
-
- {subtitle} +
+ {normalizedSubtitle}