mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #19545] [CLOSED] Fix/pdf export mermaid rendering #25245
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/19545
Author: @chaitu426
Created: 11/27/2025
Status: ❌ Closed
Base:
dev← Head:fix/pdf_export_mermaid_rendering📝 Commits (6)
fe6783cMerge pull request #19030 from open-webui/devfc05e0aMerge pull request #19405 from open-webui/deve3faec6Merge pull request #19416 from open-webui/dev9899293Merge pull request #19448 from open-webui/dev140605eMerge pull request #19462 from open-webui/dev2189dd5fix(pdf-export): prerender Mermaid before html2canvas snapshot📊 Changes
1 file changed (+26 additions, -0 deletions)
View changed files
📝
src/lib/components/layout/Sidebar/ChatMenu.svelte(+26 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request.
Before submitting, ensure the following:
devfix:Fix: Mermaid diagrams not rendering in exported PDF
Fixes #19227
This PR ensures that Mermaid diagrams are fully rendered before
html2canvastakes a snapshot for stylized PDF export.Why this is needed
Currently, Mermaid diagrams are rendered after the DOM is cloned for PDF generation. This causes empty or broken diagrams in the exported PDF. Triggering Mermaid rendering before cloning ensures that all diagrams appear correctly.
What this PR changes
MERMAID_RENDER()step before cloning the chat DOM.Testing notes
Changelog Entry
Fixed: Mermaid diagrams are intended to render correctly in exported PDFs, and chat action buttons are hidden during export.
Breaking Changes: None
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
Acknowledgment
Thanks to @ShirasawaSama for reporting this issue in #19227.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.