mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #5655] [MERGED] fix: Fix KaTeX Rendering #60586
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/5655
Author: @sp301415
Created: 9/24/2024
Status: ✅ Merged
Merged: 9/24/2024
Merged by: @tjbck
Base:
dev← Head:dev📝 Commits (6)
2145463fix: fix katex rendering377cc42fix: Remove unnecessary logging0bfbacefix: Simplify regexe48d66ffix: Remove unnecessary logging3f1255bfix: Change inline and block delimiters30e65b3fix: Add comments📊 Changes
2 files changed (+88 additions, -91 deletions)
View changed files
📝
src/lib/utils/index.ts(+0 -18)📝
src/lib/utils/marked/katex-extension.ts(+88 -73)📄 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
This PR attempts to fix some issues in KaTex rendering, including:
$...$Changed
$$...$$is now correctly registered as displaymathScreenshots or Videos
Here is the screenshot of previous version. The model is Qwen 2.5, which notably uses

\(...\)and\[...\]as math delimiters.Notice that block math equation is rendered as inline math equations, and some inline equations are not rendered.
In comparison, here is the screenshot after this PR:

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.