@matheusbsbs / matheus-bagliano / commits / b9759f0762
Fork 0

gitweb: Fix blob linenr links in pathinfo mode

In pathinfo mode, we use <base href> that refers to the base location of gitweb in order for various external media links to work well. However, this means that for the page to refer to itself, it must regenerate full link, and this is exactly what the blob view page did not do for line numbers. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Petr Baudis committed Nov 6, 2009 at 16:08 UTC b9759f0762c17a5b7bc36af98613c67249931330
1 file changed +2 -1
gitweb/gitweb.perl
+2 -1
@@ -5065,7 +5065,8 @@ sub git_blob {
5065 chomp $line;
5066 $nr++;
5067 $line = untabify($line);
5068 - printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
5068 + printf "<div class=\"pre\"><a id=\"l%i\" href=\"" . href(-replay => 1)
5069 + . "#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
5070 $nr, $nr, $nr, esc_html($line, -nbsp=>1);
5071 }
5072 }