mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-02 06:39:02 -05:00
[PR #14316] [MERGED] fix: Handle special cases of LLM output not following markdown syntax #78315
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/14316
Author: @Yu-QX
Created: 5/25/2025
Status: ✅ Merged
Merged: 5/26/2025
Merged by: @tjbck
Base:
dev← Head:main📝 Commits (6)
49fe137fix: Handle special cases of LLM output not following markdown syntax 202505258ef7938fix: 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.4483fa9Perfect the logic of case 1.1.x254dd42Integrate file intoindex.ts.b9f74a6Seperate intoprocessChineseContentbb62bd9Extracting the traversal.📊 Changes
1 file changed (+64 additions, -0 deletions)
View changed files
📝
src/lib/utils/index.ts(+64 -0)📄 Description
fix: Handle special cases of LLM output not following markdown syntax
The $2^{\text{nd}}$ change basing on Discussion #14085.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
specialCasesto handle special cases of LLM output that do not follow markdown syntax, particularly focusing on Chinese characters and parentheses. The function ensures that the original text is modified as little as possible while addressing specific rendering issues.Added
$lib/utils/processResponseContent/specialCases.tsto handle special cases of LLM output.$lib/utils/processResponseContent/to organize utility functions for processing response content.Changed
processResponseContentfunction in$lib/utils/index.tsto include the newspecialCasesfunction.Fixed
Additional Information
$lib/utils/processResponseContent/folder.specialCasesis designed to handle specific cases and should not be used for general markdown parsing issues.Screenshots or Videos
The changes are visual, and the screenshots demonstrate the improvement in rendering.
Before the changes:
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.