diff options
author | Eric Wong <e@80x24.org> | 2019-01-01 09:44:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-04-22 02:34:37 +0000 |
commit | 7c692e6137697de8a8473c4de5c3de4fb03a2989 (patch) | |
tree | 23756a60947bd08b2ddf85aad739a79c8ce51d07 /ui-diff.c | |
parent | d47734a426c6a1c5bb53eb715582f689daa5ca06 (diff) | |
download | cgit-7c692e6137697de8a8473c4de5c3de4fb03a2989.tar.gz |
ui-diff: preserve spaces w/o CSS on context lines
We need to use a non-breaking space entity to preserve spacing for browsers without CSS support.
Diffstat (limited to 'ui-diff.c')
-rw-r--r-- | ui-diff.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -222,7 +222,6 @@ static void cgit_print_diffstat(const struct object_id *old_oid, static void print_line(char *line, int len) { char *class = "ctx"; - char c = line[len-1]; if (line[0] == '+') class = "add"; @@ -232,10 +231,8 @@ static void print_line(char *line, int len) class = "hunk"; htmlf("<div class='%s'>", class); - line[len-1] = '\0'; - html_txt(line); + html_ntxt_pre(line, len - 1); html("</div>"); - line[len-1] = c; } static void header(const struct object_id *oid1, char *path1, int mode1, |