Merge pull request #15029 from Classic298/correct-markdown-rendering-model-descriptions

fix: Correct markdown rendering model descriptions
This commit is contained in:
Tim Jaeryang Baek 2025-06-18 12:50:31 +04:00 committed by GitHub
commit e79f31b9c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View File

@ -46,7 +46,7 @@
>
<Tooltip
content={marked.parse(
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description ?? '')
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description ?? '').replaceAll('\n', '<br>')
)}
placement="right"
>
@ -96,7 +96,7 @@
class="mt-0.5 text-base font-normal text-gray-500 dark:text-gray-400 line-clamp-3 markdown"
>
{@html marked.parse(
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description)
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description).replaceAll('\n', '<br>')
)}
</div>
{#if models[selectedModelIdx]?.info?.meta?.user}

View File

@ -27,7 +27,8 @@
let tokens = [];
const options = {
throwOnError: false
throwOnError: false,
breaks: true
};
marked.use(markedKatexExtension(options));

View File

@ -164,7 +164,7 @@
<Tooltip
className=" w-fit"
content={marked.parse(
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description ?? '')
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description ?? '').replaceAll('\n', '<br>')
)}
placement="top"
>
@ -172,7 +172,7 @@
class="mt-0.5 px-2 text-sm font-normal text-gray-500 dark:text-gray-400 line-clamp-2 max-w-xl markdown"
>
{@html marked.parse(
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description)
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description ?? '').replaceAll('\n', '<br>')
)}
</div>
</Tooltip>