Skip to content

[Bug]: Pasting rich text with hyperlinks into composer drops URLs instead of converting to Markdown links #42058

Done

Description

@asdlem

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Copy rich text containing a hyperlink from a web page, document, or chat app (where clipboard text/html contains <a href="https://github.com/KKKKhazix/agent-autoloop">Agent-Autoloop 仓库</a> and text/plain only has 实现参考另附 Agent-Autoloop 仓库).
  2. Paste it into the T3 Code chat composer (normal paste, not Paste as Plain Text and not inside a code block).

Expected behavior

Hyperlinks from text/html should be preserved as Markdown links in the composer (matching Codex and standard Markdown editors), e.g.:

实现参考另附 [Agent-Autoloop 仓库](https://github.com/KKKKhazix/agent-autoloop)

(While keeping literal plain-text paste behavior inside code blocks and when using "Paste as Text".)

Actual behavior

The hyperlink URL is silently stripped and only plain text is pasted:

实现参考另附 Agent-Autoloop 仓库

Impact

Minor bug or occasional failure

Version or commit

main @ 86349553c5

Root cause notes

  • ComposerPromptEditorTiptap.tsx (handlePaste) reads only text/plain via readPastedPlainText(clipboardData) in apps/web/src/components/composerInlineTokenPaste.ts.
  • text/html on paste is currently only inspected for T3 internal context chips (decodeComposerContextClipboardHtml) and image detection (clipboardHtmlImageContent), and Tiptap's link extension is disabled (link: false).
  • apps/web/src/components/chat/composerFocusRedirect.ts (pasteTextToFocusComposer) and apps/web/src/components/chat/ChatComposer.tsx (onComposerPaste / foldPastedText) also read only text/plain.
  • Note: apps/web/src/markdown-clipboard.ts already handles DOM-to-Markdown serialization on copy, but there is no equivalent HTML link conversion on paste.

Workaround

Manually copy the link URL separately and paste it into the composer.

Activity

  1. added a commit that references this issue on Nov 24, 2026
    3c8d2bd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions