mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #20801] issue: HTML Preview renders code blocks inside thinking blocks #34820
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 @IDEDARY on GitHub (Jan 19, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20801
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.7.1
Ollama Version (if applicable)
No response
Operating System
Ubuntu 24
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
The preview should render only code that is outside of thinking block
Actual Behavior
Merges all codeblocks into one and renders them, does not matter if they are inside thinking block
Steps to Reproduce
Logs & Screenshots
Additional Information
No response
@owui-terminator[bot] commented on GitHub (Jan 19, 2026):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#20719 issue: The MATLAB code block is not properly highlighted.
by 17Reset • Jan 16, 2026 •
bug#20632 issue: Inconsistent behavior when editing section breaks.
by jdwx • Jan 13, 2026 •
bug#14541 issue: Rendering an artifact with an error breaks code blocks.
by MicahZoltu • May 31, 2025 •
bug#18922 issue: When code is present in the return output, the dialog box does not use code blocks.
by pureGavin • Nov 04, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@tjbck commented on GitHub (Jan 22, 2026):
Testing wanted with dev branch here!
@adhusch commented on GitHub (Feb 10, 2026):
Tested using [git-3567054-slim] (dev-slim). I see a model dependent behaviour. Works for GPT-OSS, for Mistral Magistral see screeshot:
@adhusch commented on GitHub (Feb 17, 2026):
Issue still exists for Magistral models in 0.8.2. @tjbck could we re-open please? Let me know when i could help with testing something more specific.
@motosir commented on GitHub (Mar 3, 2026):
Using latest version of Open WebUI (fresh install today), I have seen the same issue with glm 4.7 Flash

@adhusch commented on GitHub (Mar 4, 2026):
@EntropyYue as you did original PR wich lead to fix for GPT OSS: any hint on this model specific behaviour? Maybe because of different reasoning formats? Thank you.
@adhusch commented on GitHub (Mar 5, 2026):
@Classic298 Hello, could we reopen this please?
@Classic298 commented on GitHub (Mar 5, 2026):
@adhusch no, but feel free to open a new issue with reproduction steps. If there is any way to fully reproduce it, then we will be able to actually fix it :)
@adhusch commented on GitHub (Mar 5, 2026):
@Classic298 thx, #22267