]> Lady’s Gitweb - Gitweb/commit
gitweb: Refactor syntax highlighting support
authorJakub Narebski <redacted>
Tue, 27 Apr 2010 19:34:45 +0000 (21:34 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:39 +0000 (00:50 -0400)
commit6f6ee936555f529a58142f0da31c4b4f7a46a34ab6f9cecc704f90731df7b586
tree3a671aef139bcdb49c5757a4498275e57e5516490d06172665349289ec97cea0
parent403b88e6b103b4c667c3c2cb5470583181b4d42eec03b27c11a58e7c7dd67a0d
gitweb: Refactor syntax highlighting support

This refactoring (adding guess_file_syntax and run_highlighter
subroutines) is meant to make it easier in the future to add support
for other syntax highlighing solutions, or make it smarter by not
re-running `git cat-file` second time.

Instead of looping over list of regexps (keys of %highlight_type hash),
make use of the fact that choosing syntax is based either on full
basename (%highlight_basename), or on file extension (%highlight_ext).

Add some basic test of syntax highlighting (with 'highlight' as
prerequisite) to t/t9500-gitweb-standalone-no-errors.sh test.

While at it make git_blob Perl style prettier.

Signed-off-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.201428 seconds and 4 git commands to generate.