mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
LaTeX not rendered correctly in some cases (with Chinese) #1417
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?
Originally created by @AnotiaWang on GitHub (Jul 1, 2024).
Bug Report
Description
Bug Summary:
The UI cannot render LaTeX correctly when using LLM with Chinese. An expression can be shown only when it is enclosed with
[], like:It won't work when
[and]are on separate lines, also when expressions are enclosed with$.Steps to Reproduce:
Ask a model to answer or explain a math problem in Chinese. You can also use the following output (edit a model's response and replace it):
Click to expand
Expected Behavior:

The LaTeX in the response should be rendered. For example, here are two LaTeX expressions:
Actual Behavior:

For the example above, the renderer takes Chinese characters between two
$as LaTeX.Environment
Open WebUI Version: 0.3.7
Ollama (if applicable): None
Operating System: macOS Sequoia
Browser (if applicable): Vivaldi 6.8.3381.46 (Stable channel) (arm64)
Reproduction Details
Confirmation:
Logs and Screenshots
Screenshots (if applicable):

Rendered output for the example response:
Installation Method
Docker
Additional Information
None
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!