diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to '')
-rw-r--r--source/ui-tree.c4
1 file changed, 2 insertions, 2 deletions
diff --git a/source/ui-tree.c b/source/ui-tree.c
index 13a9787..1d8bb3d 100644
--- a/source/ui-tree.c
+++ b/source/ui-tree.c
@@ -113,7 +113,7 @@ static void print_text_buffer(const char *filename, char *buf, size_t size)
}
html("<td class='lines'><pre><code>");
- html_txt(buf);
+ html_blob_txt(buf, size);
html("</code></pre></td></tr></table>\n");
}
@@ -188,7 +188,7 @@ static bool print_object(const struct object_id *oid, const char *path,
return false;
}
// buffer_is_binary only sniffs the front of the blob, and a NUL past
- // that window would end the escaped text render early while the line
+ // that window would end a Lua filter's output early while the line
// number column still counts the whole file, so check the rest too.
is_binary = buffer_is_binary(buf, size) || memchr(buf, 0, size);