element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.05k stars 1.97k forks source link

Pasting messages from Element into rich-text editors results in numbered lists #22229

Open grahamc opened 2 years ago

grahamc commented 2 years ago

Steps to reproduce

From a message, copy paste some of the text. For example, triple-click on a single line of text to select the paragraph and copy:

image

Then paste it into another program. For example, Slack or a Google Spreadsheet, or Superhuman, or another place that does rich-text formatting of the pasted text.

Outcome

What did you expect?

I expected the text to be pasted as regular text, like this:

image

What happened instead?

The single line of copied text gets turned in to several numbered points:

image

Operating system

Linux, NixOS Unstable

Application version

Element version: 1.10.11 Olm version: 3.2.8

How did you install the app?

Nix

Homeserver

chat.nixos.org

Will you send logs?

No


Note this is identical to #7081, which was spuriously closed.

grahamc commented 2 years ago

Paraphrasing from a friend:

Most likely they're using <ol> / <li> internally to build the DOM. Unfortunately, li has semantic meaning that doesn't apply here, and <div>s are more correct.

grahamc commented 2 years ago

It may be related that if I triple click a message that was edited which has a message after it, some of the next message gets copied:

image

(also reported in https://github.com/vector-im/element-web/issues/22230)

t3chguy commented 2 years ago

Most likely they're using

    /
  1. internally to build the DOM. Unfortunately, li has semantic meaning that doesn't apply here, and
    s are more correct.

The timeline is a message list, it very much is the appropriate semantic meaning. For screen reader users having the underlying list exposed as such helps more appropriate readouts.

grahamc commented 2 years ago

I don't mean to be a bother, but I really hate it when I copy paste something out of Element into Slack and it does something completely unreasonable. I've talked to some accessibility folks who don't feel like it being a ordered list and it feels like representing it that way is really punishing me as a user. I copy and paste stuff out of chat a lot, and I can't express how deeply frustrating this is. Little issues like this add up a lot to me and my overall experience is really unhappy.