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

Copying text from source code view/diff view adds or removes newlines #12184

Closed
2 of 7 tasks
CirnoT opened this issue Jul 8, 2020 · 2 comments · Fixed by #12191
Closed
2 of 7 tasks

Copying text from source code view/diff view adds or removes newlines #12184

CirnoT opened this issue Jul 8, 2020 · 2 comments · Fixed by #12191
Labels

Comments

@CirnoT
Copy link
Contributor

CirnoT commented Jul 8, 2020

  • Gitea version (or commit ref): dbd5e4b
  • Git version: gitea:latest
  • Operating system: gitea:latest
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

Copying selected chunk of text from source code/diff view either removes all newlines or produces additional ones when unnecessary. Removal happens on Chromium, while on Firefox newlines are added.

Screenshots

https://try.gitea.io/L0veSunshine/drone-gitea-release/src/branch/master/Dockerfile.arm

Original:
chrome_2020-07-08_13-43-12

Firefox:

FROM plugins/base:multiarch

LABEL maintainer="Drone.IO Community <[email protected]>" \

  org.label-schema.name="Drone Gitea Release" \

  org.label-schema.vendor="Drone.IO Community" \

  org.label-schema.schema-version="1.0"

ADD release/linux/arm/drone-gitea-release /bin/

ENTRYPOINT [ "/bin/drone-gitea-release" ]

Chromium:

FROM plugins/base:multiarch
LABEL maintainer="Drone.IO Community <[email protected]>" \
  org.label-schema.name="Drone Gitea Release" \
  org.label-schema.vendor="Drone.IO Community" \
  org.label-schema.schema-version="1.0"
ADD release/linux/arm/drone-gitea-release /bin/
ENTRYPOINT [ "/bin/drone-gitea-release" ]
@lunny lunny added the type/bug label Jul 8, 2020
@silverwind
Copy link
Member

Also noticed this, it's a regression from #12047.

mrsdizzie added a commit to mrsdizzie/gitea that referenced this issue Jul 8, 2020
Fix regression casued by go-gitea#12047 so copy/paste works properly in all browsers.

Fixes go-gitea#12184

Also while looking at this I saw a small display issue for blame view. I think go-gitea#12023 was merged into original PR through an update branch before go-gitea#12047 was merged and made one of the css ruules not apply anymore.
@mrsdizzie
Copy link
Member

Added PR that should fix this if anybody can test

zeripath pushed a commit that referenced this issue Jul 8, 2020
* Make copy/paste work for source code

Fix regression casued by #12047 so copy/paste works properly in all browsers.

Fixes #12184

Also while looking at this I saw a small display issue for blame view. I think #12023 was merged into original PR through an update branch before #12047 was merged and made one of the css ruules not apply anymore.

* use pseudo-element to prevent copying of comment + symbol even when not visually selected

* remove added newline here should not be necessary anymore

* make sure empty line is newline so there is something to select and copy
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants