Preserve Markdown formatting when copying TUI responses (#42847)

## What changed

- Add rendered HTML alongside the original Markdown when copying a whole response through the native clipboard, so rich-text destinations preserve headings, lists, tables, code, and other formatting.
- Keep code-block, blockquote, transcript, terminal, and WSL clipboard copies as plain text.
- Escape raw HTML, omit remote image sources, and render unsupported link destinations as visible text when producing clipboard HTML.

## Testing

- Add coverage for rich formatting, local and unsafe links, inert images, fenced tables, copy selection formats, and clipboard fallbacks.

GitOrigin-RevId: c6f5edd88b65f9e9b1ddc5618442868cf47ee560
This commit is contained in:
Felipe Coury authored and copyberry committed 2026-09-04 20:38:08 +00:00
1 parent 9c4253ffc1
commit 7a8092a447
17 files changed
+329 -57

No files matched your search

+1
View File
@@ -353,6 +353,7 @@ pub(crate) enum AppEvent {
CopySelection {
text: Arc<str>,
label: String,
format: crate::clipboard_copy::CopyFormat,
},
/// Persist a submitted prompt in the cross-session message history.