[PR #24966] [CLOSED] fix(markdown): keep structural details out of prose #131618

Closed
opened 2026-05-21 17:19:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24966
Author: @noufalkv
Created: 5/20/2026
Status: ❌ Closed

Base: dev ← Head: perf/tor-chat-rendering


📝 Commits (10+)

  • 9d87e3f perf(codeblock): avoid eager work for streaming code blocks
  • a94b0e6 perf(tool-calls): lazy-decode collapsed tool results
  • 27767e4 perf(markdown): keep tool-call details out of markdown recursion
  • ed4bd3a fix(chat): prevent stale high-latency chat loads
  • 830fbfc perf(streaming): remove noisy completion proxy logs
  • 46be871 fix(chat): show navigation feedback before autosave
  • bcf336f perf(sidebar): parallelize initial chat metadata loads
  • 2c50e56 fix(markdown): keep reasoning details out of markdown recursion
  • c34221b build(frontend): make sourcemap generation configurable
  • 61b2192 fix(markdown): separate structural details from prose

📊 Changes

11 files changed (+500 additions, -149 deletions)

View changed files

📝 Dockerfile (+4 -0)
📝 src/lib/components/chat/Chat.svelte (+64 -30)
📝 src/lib/components/chat/Messages/CodeBlock.svelte (+86 -10)
📝 src/lib/components/chat/Messages/Markdown.svelte (+4 -1)
📝 src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte (+101 -68)
📝 src/lib/components/common/ToolCallDisplay.svelte (+76 -19)
📝 src/lib/components/layout/Sidebar.svelte (+11 -11)
➕ src/lib/utils/marked/details-normalization.test.ts (+92 -0)
➕ src/lib/utils/marked/details-normalization.ts (+59 -0)
📝 src/routes/+layout.svelte (+2 -9)
📝 vite.config.ts (+1 -1)

📄 Description

Why

Long assistant messages can contain Open WebUI structural <details> blocks for reasoning and tool calls. When a structural tool block follows assistant prose without a block boundary, Marked can parse the raw tag and escaped attributes as ordinary markdown, causing broken rendering and excessive DOM text in large chats.

What changed

  • Normalize only Open WebUI structural details blocks before markdown lexing.
  • Preserve consecutive structural details so grouped reasoning/tool rendering remains intact.
  • Add focused unit coverage for boundary insertion, consecutive blocks, and unmatched/ordinary details.

Testing

  • npm run test:frontend -- --run
  • Production image build completed successfully.
  • Manual logged-in browser checks on a large chat with reasoning/tool details: desktop, mobile viewport, and Chromium with JavaScript JIT disabled. No raw structural <details> tags or escaped &gt; / &quot; entities were visible before or after expanding grouped details.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/24966 **Author:** [@noufalkv](https://github.com/noufalkv) **Created:** 5/20/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `perf/tor-chat-rendering` --- ### 📝 Commits (10+) - [`9d87e3f`](https://github.com/open-webui/open-webui/commit/9d87e3f2e5a32b6c5dd11d8c0e1a405b5ea66b78) perf(codeblock): avoid eager work for streaming code blocks - [`a94b0e6`](https://github.com/open-webui/open-webui/commit/a94b0e67a8727da2143925a129188d0a2d979ccc) perf(tool-calls): lazy-decode collapsed tool results - [`27767e4`](https://github.com/open-webui/open-webui/commit/27767e41b1146e077169152e6272bbe0ed3a0ecf) perf(markdown): keep tool-call details out of markdown recursion - [`ed4bd3a`](https://github.com/open-webui/open-webui/commit/ed4bd3aecb592e8339bc7a4ed180da730c809ff3) fix(chat): prevent stale high-latency chat loads - [`830fbfc`](https://github.com/open-webui/open-webui/commit/830fbfc6cea09cad13934047dffa8534694e5fd0) perf(streaming): remove noisy completion proxy logs - [`46be871`](https://github.com/open-webui/open-webui/commit/46be871d946e407b8f2bbc6129a1175d0d0966ba) fix(chat): show navigation feedback before autosave - [`bcf336f`](https://github.com/open-webui/open-webui/commit/bcf336fcaad020c49cfa25b4a8887de0f5dd165d) perf(sidebar): parallelize initial chat metadata loads - [`2c50e56`](https://github.com/open-webui/open-webui/commit/2c50e56ab3246a88820fbf01066953f75a720225) fix(markdown): keep reasoning details out of markdown recursion - [`c34221b`](https://github.com/open-webui/open-webui/commit/c34221b7c6d5e16c656b8aae5fd621fe13ba6299) build(frontend): make sourcemap generation configurable - [`61b2192`](https://github.com/open-webui/open-webui/commit/61b21920a341c37183d361db70d4ec0c8027f2a5) fix(markdown): separate structural details from prose ### 📊 Changes **11 files changed** (+500 additions, -149 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+4 -0) 📝 `src/lib/components/chat/Chat.svelte` (+64 -30) 📝 `src/lib/components/chat/Messages/CodeBlock.svelte` (+86 -10) 📝 `src/lib/components/chat/Messages/Markdown.svelte` (+4 -1) 📝 `src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte` (+101 -68) 📝 `src/lib/components/common/ToolCallDisplay.svelte` (+76 -19) 📝 `src/lib/components/layout/Sidebar.svelte` (+11 -11) ➕ `src/lib/utils/marked/details-normalization.test.ts` (+92 -0) ➕ `src/lib/utils/marked/details-normalization.ts` (+59 -0) 📝 `src/routes/+layout.svelte` (+2 -9) 📝 `vite.config.ts` (+1 -1) </details> ### 📄 Description ## Why Long assistant messages can contain Open WebUI structural `<details>` blocks for reasoning and tool calls. When a structural tool block follows assistant prose without a block boundary, Marked can parse the raw tag and escaped attributes as ordinary markdown, causing broken rendering and excessive DOM text in large chats. ## What changed - Normalize only Open WebUI structural details blocks before markdown lexing. - Preserve consecutive structural details so grouped reasoning/tool rendering remains intact. - Add focused unit coverage for boundary insertion, consecutive blocks, and unmatched/ordinary details. ## Testing - `npm run test:frontend -- --run` - Production image build completed successfully. - Manual logged-in browser checks on a large chat with reasoning/tool details: desktop, mobile viewport, and Chromium with JavaScript JIT disabled. No raw structural `<details>` tags or escaped `&gt;` / `&quot;` entities were visible before or after expanding grouped details. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 17:19:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#131618