[Proposal] Add Copy Button to Text styled in a specific language #7387

Closed
opened 2025-11-02 07:24:36 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @delvh on GitHub (May 26, 2021).

Description

GitHub has added the feature to copy text styled in a specific language using

    ```<language>
    Some text
    ```

by clicking on a button that on the right-upper corner of the generated area that appears only when the user hovers over that area (see above on the right).
I find that useful as often times the reason why something has been styled in that specific language is to allow for copy and pasting code.

Originally created by @delvh on GitHub (May 26, 2021). - Gitea version (or commit ref): 1.15.0+dev-347-gc1a80b7d6 and below - Can you reproduce the bug at https://try.gitea.io: - Yes, i.e. https://try.gitea.io/delvh/kanban-test/pulls/10 ## Description GitHub has added the feature to copy text styled in a specific language using ``` ```<language> Some text ``` ``` by clicking on a button that on the right-upper corner of the generated area that appears only when the user hovers over that area (see above on the right). I find that useful as often times the reason why something has been styled in that specific language is to allow for copy and pasting code.
GiteaMirror added the topic/uitype/feature labels 2025-11-02 07:24:36 -06:00
Author
Owner

@silverwind commented on GitHub (May 27, 2021):

I plan to follow up with a few copy-related features after https://github.com/go-gitea/gitea/pull/15899.

As for this button, I think I'd prefer if it would copy plain text without fences but I see there may be a necessity to have both options, e.g. "Copy as Markdown" and "Copy as Plain Text". Same goes for the copy feature on lines when viewing a file.

@silverwind commented on GitHub (May 27, 2021): I plan to follow up with a few copy-related features after https://github.com/go-gitea/gitea/pull/15899. As for this button, I think I'd prefer if it would copy plain text without fences but I see there may be a necessity to have both options, e.g. "Copy as Markdown" and "Copy as Plain Text". Same goes for the copy feature on lines when viewing a file.
Author
Owner

@delvh commented on GitHub (May 27, 2021):

Wait… When is there a necessity to copy text as markdown?

@delvh commented on GitHub (May 27, 2021): Wait… When is there a necessity to copy text as markdown?
Author
Owner

@silverwind commented on GitHub (Jun 2, 2021):

Ah, no there actually is no copying as markdown, I was just confused by copying above block because it in itself is markdown. We should always copy plain.

@silverwind commented on GitHub (Jun 2, 2021): Ah, no there actually is no copying as markdown, I was just confused by copying above block because it in itself is markdown. We should always copy plain.
Author
Owner

@yardenshoham commented on GitHub (Oct 22, 2022):

I think this has been implemented and can be closed.

@yardenshoham commented on GitHub (Oct 22, 2022): I think this has been implemented and can be closed.
Author
Owner

@delvh commented on GitHub (Oct 22, 2022):

Yep, I think I remember that as well.

@delvh commented on GitHub (Oct 22, 2022): Yep, I think I remember that as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7387