feat: render Markdown in chat error messages (#34955)

Providers and the proxies in front of them often write errors for people, with bold text, a list of things to try, a link to a status page or an id to quote, but the error box under a reply showed the Markdown marks as typed and the links as plain text. The error box now renders its message the way replies are rendered, so links open like links in replies, and single line breaks still show as line breaks, as they have since #34954. HTML and images in an error are shown as text and never rendered, and a plain one-line error looks exactly as before.

Fixes #34951
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-24 21:41:02 +04:00
1 parent acdb7b5038
commit 8b185d8d2c
1 file changed
+5 -2
@@ -1,5 +1,6 @@
<script lang="ts">
import Info from '$lib/components/icons/Info.svelte';
import Markdown from './Markdown.svelte';
export let content: unknown = '';
@@ -42,7 +43,9 @@
>
<Info className="mt-0.5 size-4 shrink-0 text-base-400 dark:text-base-500" strokeWidth="1.8" />
<div class="min-w-0 whitespace-pre-line break-words text-[0.8125rem] leading-5">
{message}
<div
class="markdown-prose min-w-0 text-[0.8125rem]! leading-5! text-base-500! dark:text-base-400! [&_p]:leading-5!"
>
<Markdown content={message} allowRemoteContent={false} editCodeBlock={false} />
</div>
</div>