zulip/web
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
..
e2e-tests eslint: Fix unicorn/prefer-dom-node-dataset. 2025-10-07 22:42:50 -07:00
generated
html web: Sync content of Django and nginx error pages. 2025-04-03 17:09:46 -07:00
images help: Disallow class in svg. 2025-07-23 11:24:12 -07:00
server
shared drodpown: Do not use fa-ban icon for disabled option. 2025-10-20 16:30:06 -07:00
src paste: Prevent insertion of extraneous newlines in Firefox. 2025-10-27 16:19:22 -07:00
styles user-profile: Fix textarea being too small in "Manage user" modal. 2025-10-24 07:15:26 -07:00
templates templates: Tweak demo-owner-update-email-field-hint text. 2025-10-21 18:02:36 -07:00
tests paste: Prevent insertion of extraneous newlines in Firefox. 2025-10-27 16:19:22 -07:00
third alerts: Restore alert-success colors. 2025-07-09 14:04:52 -07:00
.browserslistrc browserslist: Add support for logical props. 2025-05-21 15:19:08 -07:00
.gitignore
babel.config.js babel: Type-check Babel configuration. 2025-09-10 09:44:44 -07:00
debug-require-webpack-plugin.ts debug-require: Rename to *.cjs. 2024-11-13 09:18:56 -08:00
debug-require.cjs debug-require: Rename to *.cjs. 2024-11-13 09:18:56 -08:00
postcss.config.js postcss: Type-check PostCSS configuration. 2025-09-10 09:44:44 -07:00
webpack.assets.json tabbed-instructions: Delete activate_correct_tab. 2025-09-04 09:37:34 -07:00
webpack.config.ts webpack: Disable cross-origin-header-check middleware. 2025-04-15 16:18:06 -07:00
webpack.dev-assets.json help: Add default page to display on /help when help server is off. 2025-09-26 11:41:10 -07:00