---
id: bd94a078-ded3-470f-b5e8-ca01e4318be5
title: 'diff: block rows separated by newlines render a blank line between every row'
state: closed
labels:
- ui
assignees: []
milestone: null
created: 2026-10-27T17:24:52.438675160Z
updated: 2026-10-27T17:45:41.716932835Z
---
## What

`diff_html` emits block-level rows separated by literal `\n` inside `<pre>`:

```
</span>\n<span class="df-line" ...>
```

`pre` preserves whitespace, so each newline creates an extra empty line box between rows. Every diff row is followed by a blank row — the diff looks striped and is twice as tall.

## Reproduced

`/commit/<sha>.html` and PR Patch sections, desktop and mobile. HTML confirms `</span>\n<span class="df-line"`; screenshot shows green/pink bands with white gaps equal to line height.

## Impact

Poor readability of the core review surface; mobile diffs get very long.

## Fix

Emit no newline between block rows (or make rows inline-block and keep newlines; but then full-width backgrounds need attention). Keep the newlines out of the `<pre>` and let each row be a block. Add a test asserting no `</span>\n<span class="df-line"` and a visual check.
