Skip to content

Highlighted diff emitting extraneous newlines #12172

Closed
@silverwind

Description

@silverwind

Example: https://try.gitea.io/silverwind/updates/commit/03967f99a6cbb87c7ea7385d264ed42539b0162f

#12047 seems to cause text in diffs to sometimes split up a single line:

image

It should be

image

I think the issue is that either we or chroma are emitting newlines where there shouldn't be ones. Here's the raw HTML of line 2 line with three newlines present on a single actual line:

<span class="mono wrap">	npx ver 
<span class="added-code"><span class="err">-</span><span class="err">C</span> 
</span><span class="err">p</span><span class="err">a</span><span class="err">t</span><span class="err">c</span><span class="err">h</span>
</span>

cc: @mrsdizzie

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions