Quoting a single spaced URL drops the link.
Author: apoorvapendseCreated Sep 15, 2026Updated Sep 30, 2026
Labelsbugarea: composecore team candidate
Selecting an entire rendered link like
`[https://example.com/docs/my file.pdf](https://example.com/docs/my%20file.pdf)`
and quoting or copy-pasting that selection inserts the visible text,
which then doesn't auto-link.
The clipboard fixture is looks like `` and `P` isn't in
`outer_elements_to_retain`, so we end up just using the text node value.
https://github.com/zulip/zulip/blob/48c69911c7dd4e03b20552eb3bd77ad8151c1357/web/src/compose_paste.ts#L263-L296
which just returns the first text node's value:
https://github.com/zulip/zulip/blob/48c69911c7dd4e03b20552eb3bd77ad8151c1357/web/src/compose_paste.ts#L120-L137
Quoting a selection selection goes through `get_message_selection`.
We should fix this to get back the `[link text](url)` format for this case.
Selecting just the `` (which we do retain) or quoting the whole
message via raw content does keep the original markdown.
prev discussion: https://github.com/zulip/zulip/pull/39986#discussion_r3904730828
Source: zulip/zulip