Skip to content

Commit b9759f0

Browse files
Petr Baudisgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 78d553b commit b9759f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gitweb/gitweb.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5065,7 +5065,8 @@ sub git_blob {
50655065
chomp $line;
50665066
$nr++;
50675067
$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",
50695070
$nr, $nr, $nr, esc_html($line, -nbsp=>1);
50705071
}
50715072
}

0 commit comments

Comments
 (0)