From 1f803ace908120c8e048c3ae40f8e64651e8f6f1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 23 Dec 2015 10:00:20 +0000 Subject: repobrowse: linkify hunk headers A work-in-progress, but this provides useful links to the exact line number of modified lines instead of blindly linking to the top-of-the-file. Avoid flooding the user with links but give hints by bolding the final resulting file or SHA-1 object ID. Do other repository viewers do this? --- lib/PublicInbox/Hval.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/PublicInbox/Hval.pm') diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm index 2e8b1d60..a16cd4a1 100644 --- a/lib/PublicInbox/Hval.pm +++ b/lib/PublicInbox/Hval.pm @@ -74,6 +74,12 @@ sub ascii_html { sub as_html { ascii_html($_[0]->{raw}) } sub as_href { ascii_html(uri_escape_utf8($_[0]->{href})) } +sub as_path { + my $p = uri_escape_utf8($_[0]->{href}); + $p =~ s!%2[fF]!/!g; + ascii_html($p); +} + sub raw { if (defined $_[1]) { $_[0]->{raw} = $_[1]; -- cgit v1.2.3-24-ge0c7