mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #22237] [MERGED] fix: TTS reading thinking content when reasoning has code blocks #65419
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/22237
Author: @Classic298
Created: 3/4/2026
Status: ✅ Merged
Merged: 3/6/2026
Merged by: @tjbck
Base:
dev← Head:fix/tts-reading-thinking-content📝 Commits (1)
b5db049fix: TTS reading thinking content when reasoning has code blocks📊 Changes
1 file changed (+17 additions, -7 deletions)
View changed files
📝
src/lib/utils/index.ts(+17 -7)📄 Description
removeAllDetails() used replaceOutsideCode() which splits content on triple-backtick code blocks before applying the details-removal regex.
When thinking/reasoning content inside a
<details>block contained code blocks (backticks survive html.escape), the<details>opening and</details>closing tags ended up in different split segments, making the regex unable to match either. This caused thinking content to leak through to TTS playback.Fix: add a direct
<details>strip (without code-block splitting) as the first step of getMessageContentParts(), which is the TTS-specific entry point. This catches the edge case while keeping removeAllDetails safe for copy-to-clipboard (where legitimate<details>inside code blocks should be preserved).Fixes #22197
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.