Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format content so that it looks pretty when copy & pasted #893

Open
matrixbot opened this issue Feb 9, 2016 · 13 comments · May be fixed by matrix-org/matrix-react-sdk#7192
Open

Format content so that it looks pretty when copy & pasted #893

matrixbot opened this issue Feb 9, 2016 · 13 comments · May be fixed by matrix-org/matrix-react-sdk#7192

Comments

@matrixbot
Copy link

Created by @ matthew:matrix.org.

@ara4n ara4n added feature P2 S-Tolerable Low/no impact on users labels Feb 14, 2016
ara4n added a commit to matrix-org/matrix-react-sdk that referenced this issue Mar 15, 2016
@ara4n
Copy link
Member

ara4n commented Mar 15, 2016

still some work to be done here, but somewhat improved by the above commit. if chrome ever implements user-select: none correctly (so that contents are ignored if you include them in a selection) then we'll be able to do better.

The only workaround I can see to hide other contents (initial-letter avatars and 6+ style avatar placeholders) is either to break the position-ing somehow to make them incredibly hard to select (ew), or render them as images via canvas (ew).

@WGH-
Copy link

WGH- commented Nov 14, 2016

Is this the bug about

test message 1Options
23:02test message 2

ending up in the clipboard instead of something more readable?

@rubo77
Copy link
Contributor

rubo77 commented Dec 20, 2016

It would already help a lot if there were a space or colon after each timestamp and if the word "Options" is not coded in the alt-tag of the options-Button because the title tag is enough to show it on mouseover, but the title tag is not copied into the clipboard.

rubo77 added a commit to rubo77/matrix-react-sdk that referenced this issue Jan 1, 2017
This solves part of the problem that the word "Options" is copied in your clipboard.

see element-hq/element-web#893
rubo77 added a commit to rubo77/vector-web that referenced this issue Jan 2, 2017
This solves part of the problem that the timestamp is  gluing at the message, when copied in your clipboard.

Example:

    23:02test message

see element-hq#893
@richvdh
Copy link
Member

richvdh commented Jan 5, 2017

It looks like user-select provides a viable solution to this now?

http://caniuse.com/#feat=user-select-none

rubo77 added a commit to rubo77/vector-web that referenced this issue Jan 24, 2017
This solves part of the problem that the timestamp is  gluing at the message, when copied in your clipboard.

Example:

    23:02test message

see element-hq#893
@ara4n
Copy link
Member

ara4n commented Mar 2, 2017

user-select doesn't work in general; on Chrome if you drag a selection over a user-select: none area it still copies it to the clipboard. You just can't /start/ dragging the selection in that area. From memory. Need to check if still true.

@rubo77
Copy link
Contributor

rubo77 commented Mar 2, 2017

It seems like in Chrome the formatting of the Copy Paste seems not that bad.

In Firefox user-select is a solution

@richvdh
Copy link
Member

richvdh commented May 8, 2017

Github's source view presents an interesting solution to this: use an empty element, with a CSS ::before selector with:

.blob-num::before {
    content: attr(data-line-number);
}

... and stick the content in the data-line-number attribute of the element. It's then visible, but not c&p'ed.

@rubo77
Copy link
Contributor

rubo77 commented May 9, 2017

So which is the better solution?

user-select 

or

::before ?

@ara4n
Copy link
Member

ara4n commented May 15, 2017

as per #893 (comment), user-select doesn't work (unless the browsers have fixed it). ::before seems like a nicer soln.

@z3ntu
Copy link
Contributor

z3ntu commented Apr 23, 2019

#7460 is/was also a bit about this and a PR of mine (matrix-org/matrix-react-sdk#2929) was merged to add user-select: none attributes to several CSS classes that transforms the copy-pasting experience from horrible to not-so-bad ;)
As mentioned in the references issue, it's tested with chromium 73.0.3683.103, electron 4.1.4 and firefox 66.0.3 and it works fine there.

@turt2live
Copy link
Member

This is even worse now with reactions:
image

@jryans
Copy link
Collaborator

jryans commented May 17, 2019

Hmm, curious, the whole action bar does have user-select: none on it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants