about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-20 09:42:34 +0000
committerEric Wong <e@80x24.org>2019-01-20 09:42:34 +0000
commita01040ed2ec1e4575947e6d589499a4c7315d90e (patch)
treeeacf2ad2c84ab5e49f8a204b20dbf9d5b661313e /lib/PublicInbox/View.pm
parentc2d12f79e78eb4ea909cac6106880c0f41e8c5fd (diff)
downloadpublic-inbox-a01040ed2ec1e4575947e6d589499a4c7315d90e.tar.gz
Having diff highlighting alone is still useful, even
if blob-resolution/recreation is too expensive or
unfeasible.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 0187ec33..41a45b0b 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -558,15 +558,17 @@ sub add_text_body {
         return attach_link($upfx, $ct, $p, $fn) unless defined $s;
 
         my ($diff, $spfx);
-        if ($ibx->{-repo_objs} && $s =~ /^(?:diff|---|\+{3}) /ms) {
+        if ($s =~ /^(?:diff|---|\+{3}) /ms) {
                 $diff = [];
-                my $n_slash = $upfx =~ tr!/!/!;
-                if ($n_slash == 0) {
-                        $spfx = '../';
-                } elsif ($n_slash == 1) {
-                        $spfx = '';
-                } else { # nslash == 2
-                        $spfx = '../../';
+                if ($ibx->{-repo_objs}) {
+                        my $n_slash = $upfx =~ tr!/!/!;
+                        if ($n_slash == 0) {
+                                $spfx = '../';
+                        } elsif ($n_slash == 1) {
+                                $spfx = '';
+                        } else { # nslash == 2
+                                $spfx = '../../';
+                        }
                 }
         };