mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #11040] [CLOSED] Fix: LaTeX rendering when using CJK #22648
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/11040
Author: @samxiaowastaken
Created: 3/2/2025
Status: ❌ Closed
Base:
dev← Head:main📝 Commits (3)
844112eUpdate Chinese translation0127df2Fix: LaTeX rendering under CJK3af9142Revert "Update Chinese translation"📊 Changes
1 file changed (+27 additions, -9 deletions)
View changed files
📝
src/lib/utils/marked/katex-extension.ts(+27 -9)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Fixed
Extra comments
Related discussions: https://github.com/open-webui/open-webui/discussions/9273#discussion-7909298
https://github.com/open-webui/open-webui/discussions/10281#discussion-7985805
The problem was found under Chinese. LLMs do not output space after CJK punctuations (especially :,、), causing LaTeX not rendering.
Example: "加法结合律:$\vec{u} + (\vec{v} + \vec{w}) = (\vec{u} + \vec{v}) + \vec{w}$”
Does not render under v0.5.18, Do render after this fix.
Tested under Claude 3.7 sonnet, no extra prompts. Problem resolved for Chinese and Japanese. Sample test prompt: "Introduce me Linear Algrbra using LaTeX in Chinese."
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.