Files
zulip/web/tests/compose_paste.test.cjs
apoorvapendse 421ba8afcf paste: Prevent insertion of extraneous newlines in Firefox.
Firefox preserves the newlines when copying a visually
line-wrapped paragraph that originally contains zero
"intentional" newlines.

This fix removes those newlines from the text content before
pasting into the compose box.

This probably won't cause removall of intentional newlines,
as they are represented with <br/> tags in the `paste_html`.

Original report: https://rust-lang.zulipchat.com/#narrow/channel/122653-zulip/topic/Copy-paste.20includes.20hard.20newlines.20when.20message.20didn't/with/544174740

Discussion: https://chat.zulip.org/#narrow/channel/9-issues/topic/extraneous.20newlines.20when.20pasting.20in.20Firefox/with/2275319

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2025-10-27 16:19:22 -07:00

44 KiB