Preserve Markdown formatting when copying transcript selections (#47896)

## Why

Transcript selections were copied as plain text, losing the formatting of rendered Markdown when pasted.

## What changed

- Retain semantic Markdown annotations through rendering, wrapping, and streaming, then serialize selected text with balanced markup.
- Preserve inline formatting, web links, headings, lists, blockquotes, and hard breaks in Markdown clipboard payloads.
- Keep code-only and other literal-only selections as plain text. In mixed selections, escape user prose and fence code, tables, and tool output to preserve their literal content.

## Testing

Add unit tests and Markdown/HTML snapshots covering partial selections, nested containers, escaping, links, resize stability, and streaming boundaries.

GitOrigin-RevId: f0476334a6bf8ad0fb57626627bd258443540852
This commit is contained in:
Felipe Coury
2026-09-24 17:55:29 +00:00
committed by copyberry
parent f6fd7f17ed
commit a33fb9751c
38 changed files with 1790 additions and 41 deletions
+4
View File
@@ -592,6 +592,10 @@ impl TranscriptView {
#[path = "transcript_view_tests.rs"]
mod tests;
#[cfg(test)]
#[path = "transcript_view/markdown_copy_tests.rs"]
mod markdown_copy_tests;
#[cfg(test)]
#[path = "transcript_view/copy_on_select_tests.rs"]
mod copy_on_select_tests;