This commit is contained in:
Timothy Jaeryang Baek
2026-06-01 12:47:59 -07:00
parent 4297c02b12
commit e90a618f45
@@ -13,7 +13,7 @@
showEmbeds showEmbeds
} from '$lib/stores'; } from '$lib/stores';
import FloatingButtons from '../ContentRenderer/FloatingButtons.svelte'; import FloatingButtons from '../ContentRenderer/FloatingButtons.svelte';
import { createMessagesList } from '$lib/utils'; import { createMessagesList, replaceOutsideCode } from '$lib/utils';
/** /**
* Extracts all top-level <details>...</details> blocks from content, * Extracts all top-level <details>...</details> blocks from content,
@@ -229,7 +229,8 @@
<Markdown <Markdown
{id} {id}
content={model?.info?.meta?.capabilities?.citations == false content={model?.info?.meta?.capabilities?.citations == false
? content.replace(/\s*(\[(?:\d+(?:#[^,\]\s]+)?(?:,\s*\d+(?:#[^,\]\s]+)?)*)\])+/g, '') ? replaceOutsideCode(content, (segment) =>
segment.replace(/\s*(\[(?:\d+(?:#[^,\]\s]+)?(?:,\s*\d+(?:#[^,\]\s]+)?)*)\])+/g, ''))
: content} : content}
{model} {model}
{save} {save}