*.del { color:#f0f }
*.head { color:#fff }
*.hunk { color:#c93 }
+
+/*
+ * highlight 3.x colors (tested 3.18)
+ * this doesn't use most of the colors available (I find too many
+ * colors overwhelming). So the #ccc default is commented out.
+ */
+.hl.num { color:#f30 }
+.hl.esc { color:#f0f }
+.hl.str { color:#f30 }
+.hl.pps { color:#f30 }
+/* .hl.slc { color:#ccc } */
+.hl.com { color:#09f }
+.hl.ppc { color:#f0f }
+/* .hl.opt { color:#ccc } */
+/* .hl.ipl { color:#ccc } */
+/* .hl.lin { color:#ccc } */
+.hl.kwa { color:#ff0 }
+.hl.kwb { color:#0ff }
+.hl.kwc { color:#ff0 }
+/* .hl.kwd { color:#ccc } */
*.del { color:#f0f }
*.head { color:#fff }
*.hunk { color:#c93 }
+
+ /*
+ * highlight 3.x colors (tested 3.18)
+ * this doesn't use most of the colors available (I find too many
+ * colors overwhelming). So the #ccc default is commented out.
+ */
+ .hl.num { color:#f30 }
+ .hl.esc { color:#f0f }
+ .hl.str { color:#f30 }
+ .hl.pps { color:#f30 }
+ /* .hl.slc { color:#ccc } */
+ .hl.com { color:#09f }
+ .hl.ppc { color:#f0f }
+ /* .hl.opt { color:#ccc } */
+ /* .hl.ipl { color:#ccc } */
+ /* .hl.lin { color:#ccc } */
+ .hl.kwa { color:#ff0 }
+ .hl.kwb { color:#0ff }
+ .hl.kwc { color:#ff0 }
+ /* .hl.kwd { color:#ccc } */
_
}
# end of auto-updated sub
use PublicInbox::WwwStream;
use PublicInbox::Linkify;
use PublicInbox::Hval qw(ascii_html to_filename);
+my $hl = eval {
+ require PublicInbox::HlMod;
+ PublicInbox::HlMod->new;
+};
+
my %QP_MAP = ( A => 'oid_a', B => 'oid_b', a => 'path_a', b => 'path_b' );
my $max_size = 1024 * 1024; # TODO: configurable
my $enc_utf8 = find_encoding('UTF-8');
my $nl = ($$blob =~ tr/\n/\n/);
my $pad = length($nl);
+ $l->linkify_1($$blob);
+ my $ok = $hl->do_hl($blob, $path) if $hl;
+ if ($ok) {
+ $blob = $ok;
+ } else {
+ $$blob = ascii_html($$blob);
+ }
+
# using some of the same CSS class names and ids as cgit
$log = "<pre>$oid $type $size bytes $raw_link</pre>" .
"<hr /><table\nclass=blob>".
} (1..$nl)) . '</pre></td>' .
'<td><pre> </pre></td>'. # pad for non-CSS users
"<td\nclass=lines><pre\nstyle='white-space:pre'><code>" .
- ascii_html($$blob) .
+ $l->linkify_2($$blob) .
'</code></pre></td></tr></table>' . $log;
html_page($ctx, 200, \$log);