gitweb: highlight: replace tabs with spaces
Consider the following code fragment: /* * test */ vim ":set list" mode shows that the first character on each line is a tab: ^I/*$ ^I * test$ ^I */$ By default, the "highlight" program will retain the tabs in the HTML output: $ highlight --fragment --syntax c test.c <span class="hl com">/*</span> <span class="hl com"> * test</span> <span class="hl com"> */</span> vim list mode: ^I<span class="hl com">/*</span>$ <span class="hl com">^I * test</span>$ <span class="hl com">^I */</span>$ In gitweb, this winds up looking something like: 1 /* 2 * test 3 */ I tried both Firefox and Opera and saw the same behavior. The desired output is: 1 /* 2 * test 3 */ This can be accomplished by specifying "--replace-tabs=8" on the highlight command line. Signed-off-by: NKevin Cernekee <cernekee@gmail.com> Acked-by: NJohn 'Warthog9' Hawley <warthog9@eaglescrag.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录