refac
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user