fix: md model desc

This commit is contained in:
Timothy J. Baek 2024-06-15 10:43:10 -06:00
parent f56da1a39f
commit 1275371e10
3 changed files with 12 additions and 5 deletions

View File

@ -8,6 +8,7 @@
import { blur, fade } from 'svelte/transition';
import Suggestions from '../MessageInput/Suggestions.svelte';
import { sanitizeResponseContent } from '$lib/utils';
const i18n = getContext('i18n');
@ -70,7 +71,9 @@
<div
class="mt-0.5 text-base font-normal text-gray-500 dark:text-gray-400 line-clamp-3 markdown"
>
{@html marked.parse(models[selectedModelIdx]?.info?.meta?.description)}
{@html marked.parse(
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description)
)}
</div>
{#if models[selectedModelIdx]?.info?.meta?.user}
<div class="mt-0.5 text-sm font-normal text-gray-400 dark:text-gray-500">

View File

@ -1,5 +1,6 @@
<script lang="ts">
import { DropdownMenu } from 'bits-ui';
import { marked } from 'marked';
import { flyAndScale } from '$lib/utils/transitions';
import { createEventDispatcher, onMount, getContext, tick } from 'svelte';
@ -333,9 +334,12 @@
{#if item.model?.info?.meta?.description}
<Tooltip
content={`${sanitizeResponseContent(
item.model?.info?.meta?.description
).replaceAll('\n', '<br>')}`}
content={`${marked.parse(
sanitizeResponseContent(item.model?.info?.meta?.description).replaceAll(
'\n',
'<br>'
)
)}`}
>
<div class="">
<svg

View File

@ -17,7 +17,7 @@
tooltipInstance.setContent(content);
} else {
tooltipInstance = tippy(tooltipElement, {
content: marked.parse(content),
content: content,
placement: placement,
allowHTML: true,
touch: touch