fix: Handle special cases of LLM output not following markdown syntax (20250525, formated) This commit introduces a utility function to address rendering issues in LLM output, particularly for Chinese characters and parentheses. The function ensures minimal modification of the original text while fixing markdown parsing problems. Changes include: - Added in for handling specific cases. - Updated in to incorporate the new utility. The fix ensures proper rendering of bold/italic text containing Chinese parentheses, improving readability for non-English content.

This commit is contained in:
YuQX committed 2025-05-25 19:37:43 +08:00
1 parent 49fe137553
commit 8ef7938c96
2 files changed
+90 -83

No files matched your search

+2 -2
View File
@@ -20,7 +20,7 @@ import markedExtension from '$lib/utils/marked/extension';
import markedKatexExtension from '$lib/utils/marked/katex-extension';
import hljs from 'highlight.js';
import { specialCases } from '$lib/utils/processResponseContent/special-cases'
import { specialCases } from '$lib/utils/processResponseContent/special-cases';
//////////////////////////
// Helper functions
@@ -92,7 +92,7 @@ export const sanitizeResponseContent = (content: string) => {
};
export const processResponseContent = (content: string) => {
// This function is used to process the response content
// This function is used to process the response content
// before the response content is rendered.
content = specialCases(content);
return content.trim();