From b927386173b179d124815e366989da07a711ab3e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 24 Oct 2026 09:17:41 -1000 Subject: Show characters a browser breaks at as escapes The HTML parser turns a carriage return with no line feed after it into a line feed, and WebKit starts a new line at U+2028 and U+2029, while git and the line numbers count line feeds alone, so each one set every later line of the tree and blame pages a line below its number. CSS Text makes vertical tab, form feed and next line forced breaks as well, though no engine honours that yet. The escapes follow gitweb, which shows control characters the same way. --- assets/cgit.css | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'assets/cgit.css') diff --git a/assets/cgit.css b/assets/cgit.css index 0d2da53..2f53559 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -653,6 +653,12 @@ div#cgit table.blob code { font: inherit; } +div#cgit span.escape { + color: var(--muted); + outline: 1px dashed var(--border-mid); + outline-offset: -1px; +} + div#cgit table.blob td.linenumbers a, div#cgit table.ssdiff td.lineno a { color: var(--muted); -- cgit 2.9.1