mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 14:13:08 -05:00
Incorrect Rendering of Nested Code Blocks in Markdown #1934
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 @frettig-radiox on GitHub (Aug 29, 2024).
Bug Report
When including a nested code block in Markdown, the rendered output did not display correctly in the UI. If the nested code block is not indented by the llm, the rendering of the code block fails.
Environment
Confirmation:
Expected Behavior:
The nested code block should be rendered correctly even if not indented.
Actual Behavior:
The nested code block gets displayed without proper formatting, which causes confusion in how the nested code appears on-screen.
Reproduction Details
Steps to Reproduce:
Logs and Screenshots
Screenshots:
Before indenting the nested code block:
After indenting the nested code block:

Reference Markdown Example:
Here's an example of the Markdown that caused the issue if it appears in the llm response:
if the python block is indented, the code
block is rendered correctly: