Avoid spurious newlines in diffs with CRLF line endings
Commit d5d9a13ec8fa62f0c36df7b75a2231663056668f fixed Issue 5091 by
adding a newline to the end of each diff line. In files with CRLF line
endings, this causes spurious newlines as described in Issue 7164.
This tweaks the aforementioned fix to specifically target empty lines
thereby still ensuring that (empty) diff lines don't collapse to 0px
height while avoiding inserting spurious newlines elsewhere.
Bug: Issue 7164
Change-Id: Iafbbf004cfb588fc123988674bbce8dfabf4d2b8
(cherry picked from commit 40eb3f47ccd088e5f14fe13f4b12eddabfec3d1d)
diff --git a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html
index f32234a..b56835f 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html
+++ b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html
@@ -158,8 +158,8 @@
.dueToRebase .content.remove {
background-color: var(--light-rebased-remove-highlight-color);
}
- .content .contentText:after {
- /* Newline, to ensure all lines are one line-height tall. */
+ .content .contentText:empty:after {
+ /* Newline, to ensure empty lines are one line-height tall. */
content: '\A';
}
.contextControl {