I have searched for any existing and/or related issues.
I have searched for any existing and/or related discussions.
I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
I am using the latest version of Open WebUI.
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
I have read and followed all instructions in README.md.
I am using the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
I have provided every relevant configuration, setting, and environment variable used in my setup.
I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
Start with the initial platform/version/OS and dependencies used,
Specify exact install/launch/configure commands,
List URLs visited, user input (incl. example values/emails/passwords if needed),
Describe all options and toggles enabled or changed,
Include any files or environmental changes,
Identify the expected and actual result at each stage,
Ensure any reasonably skilled user can follow and hit the same issue.
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
Have OpenWebUI
Have thinking model that can code
Click preview on the code and you will see that it also used code blocks inside thinking block
Logs & Screenshots
Additional Information
No response
Originally created by @IDEDARY on GitHub (Jan 19, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20801
### Check Existing Issues
- [x] I have searched for any existing and/or related issues.
- [x] I have searched for any existing and/or related discussions.
- [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
- [x] I am using the latest version of Open WebUI.
### 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
- [x] I have read and followed all instructions in `README.md`.
- [x] I am using the latest version of **both** Open WebUI and Ollama.
- [x] I have included the browser console logs.
- [x] I have included the Docker container logs.
- [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.**
- [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
- [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps:
- Start with the initial platform/version/OS and dependencies used,
- Specify exact install/launch/configure commands,
- List URLs visited, user input (incl. example values/emails/passwords if needed),
- Describe all options and toggles enabled or changed,
- Include any files or environmental changes,
- Identify the expected and actual result at each stage,
- Ensure any reasonably skilled user can follow and hit the same issue.
### 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
1. Have OpenWebUI
2. Have thinking model that can code
3. Click preview on the code and you will see that it also used code blocks inside thinking block
### Logs & Screenshots
<img width="1860" height="935" alt="Image" src="https://github.com/user-attachments/assets/a6486441-8e19-467b-b6e3-3545070f7345" />
### Additional Information
_No response_
GiteaMirror
added the bug label 2026-05-05 22:02:11 -05:00
@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:
#20719issue: The MATLAB code block is not properly highlighted. by 17Reset • Jan 16, 2026 • bug
#20632issue: Inconsistent behavior when editing section breaks. by jdwx • Jan 13, 2026 • bug
#14541issue: Rendering an artifact with an error breaks code blocks. by MicahZoltu • May 31, 2025 • bug
#18922issue: When code is present in the return output, the dialog box does not use code blocks. by pureGavin • Nov 04, 2025 • bug
💡Tips:
If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
If you found a solution in any of these issues, please share it here to help others
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
<!-- gh-comment-id:3769934543 -->
@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:
1. [#20719](https://github.com/open-webui/open-webui/issues/20719) **issue: The MATLAB code block is not properly highlighted.**
*by 17Reset • Jan 16, 2026 • `bug`*
2. [#20632](https://github.com/open-webui/open-webui/issues/20632) **issue: Inconsistent behavior when editing section breaks.**
*by jdwx • Jan 13, 2026 • `bug`*
3. [#14541](https://github.com/open-webui/open-webui/issues/14541) **issue: Rendering an artifact with an error breaks code blocks.**
*by MicahZoltu • May 31, 2025 • `bug`*
4. [#18922](https://github.com/open-webui/open-webui/issues/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:**
- If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
- If you found a solution in any of these issues, please share it here to help others
*This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Tested using [git-3567054-slim] (dev-slim). I see a model dependent behaviour. Works for GPT-OSS, for Mistral Magistral see screeshot:
<!-- gh-comment-id:3877977501 -->
@adhusch commented on GitHub (Feb 10, 2026):
> Testing wanted with dev branch here!
Tested using [git-3567054-slim] (dev-slim). I see a model dependent behaviour. Works for GPT-OSS, for Mistral Magistral see screeshot:
<img width="1506" height="656" alt="Image" src="https://github.com/user-attachments/assets/343d34a6-1040-4ca3-ad4c-9218483cbce5" />
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.
<!-- gh-comment-id:3914976030 -->
@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.
Using latest version of Open WebUI (fresh install today), I have seen the same issue with glm 4.7 Flash
<!-- gh-comment-id:3993209908 -->
@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
<img width="363" height="846" alt="Image" src="https://github.com/user-attachments/assets/330a4449-befd-4b67-92b6-2037675d0bb5" />
@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.
<!-- gh-comment-id:3996056692 -->
@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 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 :)
<!-- gh-comment-id:4004248574 -->
@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 :)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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