[GH-ISSUE #23679] feat: Render Markdown in RAG citations from knowledge base #35574

Closed
opened 2026-04-25 09:45:43 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @mingos25 on GitHub (Apr 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23679

Check Existing Issues

  • I have searched for all existing open AND closed issues and discussions for similar requests. I have found none that is comparable to my request.

Verify Feature Scope

  • I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions.

Problem Description

Currently, citations from Markdown documents in the knowledge base display raw text instead of rendered Markdown. This affects formatting like bold, italics, code blocks, lists, and tables, making technical documentation hard to read in responses. Markdown rendering works correctly in the File Inspector, but not in RAG citations. (See related discussion: https://github.com/open-webui/open-webui/discussions/16069)

Desired Solution you'd like

Citations should parse and render Markdown syntax consistently across the UI, matching the File Inspector:

  • bold → bold
  • code → code
  • Tables, lists, headers preserved
  • Improves UX for technical docs (API refs, guides)

Steps to Reproduce:

  • Upload MD file to Knowledge
  • Ask question triggering RAG: citations show raw MD (e.g. Important note)

Alternatives Considered

No response

Additional Context

I implemented a local fix by modifying two components:

1. src/lib/components/chat/Messages/Citations/CitationModal.svelte:

  • Added hasMarkdownSyntax() function to detect common markdown patterns (headers, tables, lists, blockquotes, bold/italic, links, code blocks)
  • Modified rendering logic to conditionally apply the Markdown component based on content detection
  • Added prose CSS classes with specific table styling (prose-table, prose-th, prose-td) for proper border rendering and dark mode support

2. src/lib/components/chat/Messages/Markdown.svelte:

  • Enabled GitHub Flavored Markdown (GFM) support by adding gfm: true and tables: true to marked parser options
  • This ensures proper parsing of markdown tables and extended syntax
Originally created by @mingos25 on GitHub (Apr 13, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/23679 ### Check Existing Issues - [x] I have searched for all existing **open AND closed** issues and discussions for similar requests. I have found none that is comparable to my request. ### Verify Feature Scope - [x] I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions. ### Problem Description Currently, citations from Markdown documents in the knowledge base display raw text instead of rendered Markdown. This affects formatting like bold, italics, code blocks, lists, and tables, making technical documentation hard to read in responses. Markdown rendering works correctly in the File Inspector, but not in RAG citations. (See related discussion: https://github.com/open-webui/open-webui/discussions/16069) ### Desired Solution you'd like Citations should parse and render Markdown syntax consistently across the UI, matching the File Inspector: - **bold** → bold - `code` → code - Tables, lists, headers preserved - Improves UX for technical docs (API refs, guides) Steps to Reproduce: - Upload MD file to Knowledge - Ask question triggering RAG: citations show raw MD (e.g. **Important** note) ### Alternatives Considered _No response_ ### Additional Context I implemented a local fix by modifying two components: **1. `src/lib/components/chat/Messages/Citations/CitationModal.svelte`:** - Added `hasMarkdownSyntax()` function to detect common markdown patterns (headers, tables, lists, blockquotes, bold/italic, links, code blocks) - Modified rendering logic to conditionally apply the Markdown component based on content detection - Added prose CSS classes with specific table styling (`prose-table`, `prose-th`, `prose-td`) for proper border rendering and dark mode support **2. `src/lib/components/chat/Messages/Markdown.svelte`:** - Enabled GitHub Flavored Markdown (GFM) support by adding `gfm: true` and `tables: true` to marked parser options - This ensures proper parsing of markdown tables and extended syntax
Author
Owner

@tjbck commented on GitHub (Apr 17, 2026):

Already implemented, enabled by default.

<!-- gh-comment-id:4264947127 --> @tjbck commented on GitHub (Apr 17, 2026): Already implemented, enabled by default.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35574