mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[PR #24958] fix: preserve bracketed numbers in code blocks #131613
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24958
Author: @pragnyanramtha
Created: 5/20/2026
Status: 🔄 Open
Base:
dev← Head:pragnyan/fix-code-block-citation-strip-24948📝 Commits (2)
c525c41fix: preserve bracketed numbers in code blocksd524035fix: preserve indented code citations📊 Changes
1 file changed (+37 additions, -14 deletions)
View changed files
📝
src/lib/components/chat/Messages/ContentRenderer.svelte(+37 -14)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.replaceOutsideCodeutility instead of introducing new parsing behavior.dev.fix:prefix.Changelog Entry
Description
Added
Changed
Deprecated
Removed
Fixed
data = [0]no longer render or copy asdata =when citation handling is disabled.Security
Breaking Changes
Additional Information
Validation run:
npx prettier --plugin-search-dir --check src/lib/components/chat/Messages/ContentRenderer.sveltenpx eslint src/lib/components/chat/Messages/ContentRenderer.sveltegit diff --checknpm run buildI also verified the transform behavior directly: the previous replacement removed
[0]from fenced code and[3]from inline code, while the updated path removes citation markers outside code and preserves both code examples.Screenshots or Videos
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.