diff --git a/docs/markdown-renderer.md b/docs/markdown-renderer.md index 255d68e8e..1bde975d2 100644 --- a/docs/markdown-renderer.md +++ b/docs/markdown-renderer.md @@ -24,7 +24,7 @@ Math and video are disabled. Task lists and admonitions are enabled; task checkb Mermaid fences use the existing isolated diagram runtime and fullscreen viewer. Web dispatches them through the library’s code-block override. Native has no block-renderer hook, so the renderer extracts only Mermaid fences and places the existing WebView host between library-rendered segments. This is the only block exception; see [native selection limitations](native-text-selection.md) for diagram grouping and leading inline images. Streaming keeps the last valid diagram visible while the next revision renders. -Native code blocks use the library's copy control and compiled grammars. Web code blocks use `HighlightedCodeBlock` through the library's `renderers.codeBlock` override. The patch also keeps the library's block spacing around the web code block override, preserves web list numbering and link titles, marks pending parses with `aria-busy` so Find waits for rendered text, and carries link syntax through native and web tap events. Web inline code inside a link inherits only the link colour; its code font, size and background stay intact. Keep link variants colour-only: native pills replace text runs and prevent paths from wrapping; Android pills also use the surrounding block’s font size. The package patch is tracked by [upstream PR #997](https://github.com/software-mansion/enriched-markdown/pull/997); remove the patch when the pinned release includes it. +Native code blocks use the library's copy control and compiled grammars. Web code blocks use `HighlightedCodeBlock` through the library's `renderers.codeBlock` override. Selection copy has to tell links Paseo recognized in the text (paths, forge references, code spans) from links in the Markdown, so the web link renderer marks the recognized ones. Plain-text paste carries them as the text the reply showed, and rich paste keeps them as links only when they point to an `http` or `https` URL. Authored links and parser autolinks such as a bare `www.example.com` copy as links. The patch also keeps the library's block spacing around the web code block override, preserves web list numbering and link titles, marks pending parses with `aria-busy` so Find waits for rendered text, and carries link syntax through native and web tap events. Web inline code inside a link inherits only the link colour; its code font, size and background stay intact. Keep link variants colour-only: native pills replace text runs and prevent paths from wrapping; Android pills also use the surrounding block’s font size. The package patch is tracked by [upstream PR #997](https://github.com/software-mansion/enriched-markdown/pull/997); remove the patch when the pinned release includes it. The package patch also keeps overflowing native horizontal blocks in control of their drags: Android claims parent interception at touch-down and releases it for vertical drags so the chat list can scroll; iOS keeps its scroll recognizer active for outward drags at the leading edge. This prevents compact sidebar pans from taking block scrolling without changing sidebar swipes on prose or non-overflowing blocks. Native changes require a client rebuild. diff --git a/packages/app/e2e/browser/assistant-selection-copy.spec.ts b/packages/app/e2e/browser/assistant-selection-copy.spec.ts index 0703ff134..98f23660b 100644 --- a/packages/app/e2e/browser/assistant-selection-copy.spec.ts +++ b/packages/app/e2e/browser/assistant-selection-copy.spec.ts @@ -72,14 +72,12 @@ const ASSISTANT_MARKDOWN = [ "| Current \\| active | ~~obsolete~~ | ready |", ].join("\n"); -const EXPECTED_WHOLE_SELECTION_MARKDOWN = ASSISTANT_MARKDOWN.replace( +// text/plain carries the selection as displayed, so an inline code span the renderer +// linked copies without its destination. +const EXPECTED_WHOLE_SELECTION_TEXT = ASSISTANT_MARKDOWN.replace( "www.example.com stays", "[www.example.com](http://www.example.com) stays", ) - .replace( - "`https://example.com/generated` stays", - "[`https://example.com/generated`](https://example.com/generated) stays", - ) .replace(`${CROSS_STRUCTURE_MARKDOWN}\n\n`, "") .replace( "", @@ -422,7 +420,7 @@ test("copying an assistant selection preserves Markdown structure and links", as await copySelection(page); const clipboard = await readRichClipboard(page); - expect(clipboard.plainText).toBe(EXPECTED_WHOLE_SELECTION_MARKDOWN); + expect(clipboard.plainText).toBe(EXPECTED_WHOLE_SELECTION_TEXT); expect(clipboard.html).not.toContain("