Copy-pasting text on macOS picks up nonprinting RTL unicode, causing confusion
Steps to reproduce
- Drag over some content in EXI on macOS to select it and copy it for pasting elsewhere
- Paste it somewhere else (e.g. into the composer)
- Discover that you accidentally copied a bunch of nonprinting unicode characters like
<0x2066><0x2004><0x2004><0x2004><0x2004><0x2004><0x2004>(RTL OVERRIDE and THREE-PER-EM spacing) - Watch chaos like https://github.com/element-hq/element-web/issues/30351 ensue
Outcome
What did you expect?
I'm surprised that we have a bunch of non-printing unicode clogging up our bubbles, unless the text present really is a combo of RTL & LTR or similar. The three-per-em-spacing thing looks particularly weird, as if it's being used for layout. Surely these shouldn't be picked up by the clipboard.
What happened instead?
Clipboard gets polluted with non-printing unicode.
Your phone model
No response
Operating system version
macOS 15.5
Application version
969
Homeserver
matrix.org
Will you send logs?
No
The 0x2066 is presumably coming from https://github.com/element-hq/element-x-ios/blob/develop/ElementX/Sources/Other/Extensions/LayoutDirection.swift
and the 0x2004 from https://github.com/element-hq/element-x-ios/blob/develop/ElementX/Sources/Other/Extensions/String.swift#L55
Yeah, exactly. This is the solution we came up with to reserve the space in the bubble for the timestamp etc without having to always put it on a new line. My understanding is that we couldn't use exclusionPaths at the time due to an issue with TextKit 1 vs 2.