Skip to content

Copying code to clipboard omits empty lines in some files #16434

Closed
@silverwind

Description

@silverwind

On some files like https://try.gitea.io/silverwind/symlink-test/src/branch/master/.drone.yml copying to clipboard via text selection omits emty lines in the copied content. The HTML of those empty lines does not render anything and I think we'd need to render a newline character for such empty lines so browser selection can properly pick it up. The issue does not show in all files and I think it's somehow caused by the yaml syntax highlighting.

On gitea (no newline character):

<code class="code-inner"><span class="w"></span></code>

On github (with newline character):

<td id="LC4" class="blob-code blob-code-inner js-file-line">
</td>

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UItype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions