Skip to content

Conversation

@fregante
Copy link
Member

@fregante fregante commented Jun 6, 2017

The space mentioned by #317 is:

  • added by GitHub on every line so that +/- signs would align correctly; now removed on every line
  • inside the Add Comment <button>; now made non-selectable

Replaces #453

@fregante fregante mentioned this pull request Jun 6, 2017
4 tasks
@sindresorhus
Copy link
Member

I'm still getting the spaces described in #453 (comment)

@fregante
Copy link
Member Author

fregante commented Jun 7, 2017

Can you give me a link and a screenshot of the github.com page you're selecting? I can't reproduce

@sindresorhus
Copy link
Member

I'm just selecting some code in the diff view of this PR.

screen shot 2017-06-07 at 16 06 08

screen shot 2017-06-07 at 16 06 16

@fregante
Copy link
Member Author

fregante commented Jun 7, 2017

Ah true, I must have broken it while tweaking it.

@fregante fregante force-pushed the diff-whitespace-bug branch from 596fe95 to 2ca4178 Compare June 16, 2017 10:02
@fregante
Copy link
Member Author

fregante commented Jun 16, 2017

Surprise! user-select: none doesn't actually prevent copy in Chrome and Safari. Only in Firefox (-moz-user-select: none)

In Chrome, I'll probably end up removing the whitespace-only textNode in the <button>, either on selection or on copy, the latest possible event.

Alternatively, the rule .add-line-comment {display: none!important} can be added oncopy

I think this PR can be merged for now (without closing #317), at least it's lighter than before and it works in Firefox.

@fregante fregante changed the title Simplify removeDiffSigns + fix copy-paste whitespace Simplify removeDiffSigns Jun 16, 2017
@sindresorhus sindresorhus merged commit 40fd708 into master Jun 16, 2017
@sindresorhus sindresorhus deleted the diff-whitespace-bug branch June 16, 2017 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants