Skip to content

Fix blank lines collapsing in paste view - #221

Merged
matze merged 1 commit into
matze:masterfrom
intersecato:master
Oct 2, 2026
Merged

matze merged 1 commit into
matze:masterfrom
intersecato:master

Conversation

@intersecato

Copy link
Copy Markdown
Contributor

Problem

In the paste view, blank lines were not shown. The code shifted up relative to the line numbers, and the extra line numbers piled up at the bottom of the paste. The raw view was fine.

Each line of the paste is rendered as <div id="LCn">…</div>. A blank line becomes an empty div, which the browser renders with zero height. The gutter divs have a fixed height of 1.54em, so every blank line pushed the code one row further out of alignment with the line numbers.

Fix

Give each code line min-height: 1.54em, the same height as a gutter row. Blank lines now take up one row. min-height instead of height lets long lines keep wrapping when line wrapping is on.

@matze

matze commented Oct 2, 2026

Copy link
Copy Markdown
Owner

What browser do you use and do you have a reproduction case? This seems fine on bin.bloerg.net:
image

@intersecato

Copy link
Copy Markdown
Contributor Author

@matze you can test with https://paste.atlantisrp.it/thTK314CsXh

@matze

matze commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Okay, seems I wasn't triggering it because I inserted via the form and you via the API. Thanks for the fix!

@matze
matze merged commit 0155057 into matze:master Oct 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants