Originally created by @Fishforgithub on GitHub (Nov 21, 2024).
Code blocks disappear after chat completion
Issue Description
When using Open WebUI with CodeLlama, the code blocks in the chat interface are not displaying properly. While the AI is responding, the code blocks are visible and properly formatted. However, after the response is complete, all code blocks are replaced with text saying "代碼區塊" (Code Block).
Steps to Reproduce
Start a new chat with CodeLlama in Open WebUI
Ask the AI to write any Python code
During the response, the code blocks are properly displayed with syntax highlighting
After the response is complete, all code blocks disappear and are replaced with "代碼區塊"
Expected Behavior
Code blocks should remain visible after the AI completes its response
Syntax highlighting should be maintained
The formatting should be consistent before and after response completion
Current Behavior
Code blocks are visible during AI response
After response completion, code blocks are replaced with text "代碼區塊"
The actual code content becomes inaccessible
Environment
Open WebUI Version: v0.4.1
Browser: Chrome 131.0.6778.71
OS: win 11
Model: codellama:latest
Additional Information
This issue affects all code blocks in the conversation
The problem is consistent across different chat sessions
Markdown formatting for other elements (like lists and headers) remains intact
Screenshots
Possible Related Issues
Is this related to Markdown rendering?
Could it be a CSS/JavaScript issue?
Is it related to the chat completion event handler?
Originally created by @Fishforgithub on GitHub (Nov 21, 2024).
# Code blocks disappear after chat completion
## Issue Description
When using Open WebUI with CodeLlama, the code blocks in the chat interface are not displaying properly. While the AI is responding, the code blocks are visible and properly formatted. However, after the response is complete, all code blocks are replaced with text saying "代碼區塊" (Code Block).
## Steps to Reproduce
1. Start a new chat with CodeLlama in Open WebUI
2. Ask the AI to write any Python code
3. During the response, the code blocks are properly displayed with syntax highlighting
4. After the response is complete, all code blocks disappear and are replaced with "代碼區塊"
## Expected Behavior
- Code blocks should remain visible after the AI completes its response
- Syntax highlighting should be maintained
- The formatting should be consistent before and after response completion
## Current Behavior
- Code blocks are visible during AI response
- After response completion, code blocks are replaced with text "代碼區塊"
- The actual code content becomes inaccessible
## Environment
- Open WebUI Version: v0.4.1
- Browser: Chrome 131.0.6778.71
- OS: win 11
- Model: codellama:latest
## Additional Information
- This issue affects all code blocks in the conversation
- The problem is consistent across different chat sessions
- Markdown formatting for other elements (like lists and headers) remains intact
## Screenshots


## Possible Related Issues
- Is this related to Markdown rendering?
- Could it be a CSS/JavaScript issue?
- Is it related to the chat completion event handler?
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 @Fishforgithub on GitHub (Nov 21, 2024).
Code blocks disappear after chat completion
Issue Description
When using Open WebUI with CodeLlama, the code blocks in the chat interface are not displaying properly. While the AI is responding, the code blocks are visible and properly formatted. However, after the response is complete, all code blocks are replaced with text saying "代碼區塊" (Code Block).
Steps to Reproduce
Expected Behavior
Current Behavior
Environment
Additional Information
Screenshots
Possible Related Issues