about summary refs log tree commit homepage
path: root/lib/PublicInbox/Hval.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-12-23 10:00:20 +0000
committerEric Wong <e@80x24.org>2016-04-05 18:58:27 +0000
commit1f803ace908120c8e048c3ae40f8e64651e8f6f1 (patch)
treeaf437aa9b203c0035cc3130cacc96bd4db087dab /lib/PublicInbox/Hval.pm
parent3e79993321bd0e5a12b104730638eb87947ec86b (diff)
downloadpublic-inbox-1f803ace908120c8e048c3ae40f8e64651e8f6f1.tar.gz
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?
Diffstat (limited to 'lib/PublicInbox/Hval.pm')
-rw-r--r--lib/PublicInbox/Hval.pm6
1 files changed, 6 insertions, 0 deletions
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];