Use splitlines() instead of split("\n") when displaying file contents
Lines in a text file end with a newline, even the last one, so splitting
by newline causes files viewed in git.sr.ht to appear as if they had an
extra blank line at the end.
Instead, use splitlines(), which handles the trailing newline correctly,
as well as line end sequences used by other operating systems.
1 files changed, 1 insertions(+), 1 deletions(-) M gitsrht/templates/blob.html
M gitsrht/templates/blob.html => gitsrht/templates/blob.html +1 -1
@@ 69,7 69,7 @@ pre, body { <div class="col-md-12 code-view"> <pre class="ruler"><span>{% for i in range( editorconfig.max_line_length()) %} {% endfor %}</span></pre> <pre class="lines">{% for line in data.split("\n") %}<a <pre class="lines">{% for line in data.splitlines() %}<a href="#L{{loop.index}}" id="L{{loop.index}}" >{{loop.index}}</a>{% if not loop.last %}