mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #10712] [CLOSED] feat: New 'Copy Formatted' button to preserve formatting when copied to the clipboard #38213
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/10712
Author: @MacJedi42
Created: 2/24/2025
Status: ❌ Closed
Base:
dev← Head:feature/copy-formatted-button📝 Commits (10+)
74b29c0Added 'Copy Formatted' button to preserve markdown formatting when copying AI responses to Microsoft Word or other Rich Text Applications905b94fUpdate ResponseMessage.svelteec2cd58Merge branch 'open-webui:main' into feature/copy-formatted-button2ed4545Merge branch 'open-webui:main' into feature/copy-formatted-buttona402a41Merge branch 'open-webui:main' into feature/copy-formatted-button3b70cd6Merge pull request #11257 from open-webui/dev79e9039Merge branch 'open-webui:main' into feature/copy-formatted-buttondc78d2fUpdate bug_report.yaml67cd4f2Create config.yamld7bfa39refac📊 Changes
3 files changed (+128 additions, -4 deletions)
View changed files
📝
.github/ISSUE_TEMPLATE/bug_report.yaml(+5 -3)➕
.github/ISSUE_TEMPLATE/config.yml(+1 -0)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+122 -1)📄 Description
feat: Added 'Copy Formatted' button for preserving formatting when copying AI responses to Microsoft Word or other Rich Text Applications
Pull Request Checklist
devbranch.Changelog Entry
Description
This PR adds a new "Copy Formatted" button next to the existing copy button in AI responses. When clicked, it converts the markdown to HTML with proper formatting and copies it to the clipboard, allowing users to paste formatted content into applications that support rich text (like Microsoft Word, Google Docs, email clients, etc.).
Added
copyFormattedToClipboardfunction that uses marked to convert markdown to HTMLChanged
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
This feature enhances the user experience by preserving formatting when copying AI responses. It's particularly useful for:
The implementation uses the existing marked library that's already a dependency in the project, along with the highlight.js library for code syntax highlighting.
Screenshots
Screenshot showing the new Copy Formatted button next to the existing copy button
https://github.com/user-attachments/assets/4cd06186-fbb2-4c99-9abb-fea06695041f
Video Example of formatted content pasted into Microsoft Word, showing preserved formatting
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.