X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwText.pm;h=adadc37aab3da1f32ee40a7eb0687444281b9696;hb=8b8577f91109e76d12fcfa55a2e7388f54a41be6;hp=2e58eeb4175265dc98f2e8d478a706072f9cac31;hpb=2c115a58c613d9ba18acd06f88f5c3bf03e8b8fd;p=public-inbox.git
diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index 2e58eeb4..adadc37a 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -1,6 +1,7 @@
-# Copyright (C) 2016 all contributors
+# Copyright (C) 2016-2018 all contributors
# License: AGPL-3.0+
+# used for displaying help texts and other non-mail content
package PublicInbox::WwwText;
use strict;
use warnings;
@@ -9,6 +10,10 @@ use PublicInbox::WwwStream;
use PublicInbox::Hval qw(ascii_html);
our $QP_URL = 'https://xapian.org/docs/queryparser.html';
our $WIKI_URL = 'https://en.wikipedia.org/wiki';
+my $hl = eval {
+ require PublicInbox::HlMod;
+ PublicInbox::HlMod->new
+};
# /$INBOX/_/text/$KEY/ # KEY may contain slashes
# For now, "help" is the only supported $KEY
@@ -60,7 +65,13 @@ sub get_text {
sub _do_linkify {
my $l = PublicInbox::Linkify->new;
- $_[0] = $l->linkify_2(ascii_html($l->linkify_1($_[0])));
+ $l->linkify_1($_[0]);
+ if ($hl) {
+ $hl->do_hl_text(\($_[0]));
+ } else {
+ $_[0] = ascii_html($_[0]);
+ }
+ $_[0] = $l->linkify_2($_[0]);
}
sub _srch_prefix ($$) {
@@ -87,9 +98,33 @@ sub _srch_prefix ($$) {
1;
}
+sub _colors_help ($$) {
+ my ($ctx, $txt) = @_;
+ my $ibx = $ctx->{-inbox};
+ my $env = $ctx->{env};
+ my $base_url = $ibx->base_url($env);
+ $$txt .= "color customization for $base_url\n";
+ $$txt .= <{-inbox};
@@ -181,6 +216,10 @@ message threading
$WIKI_URL/Atom_(standard)
https://tools.ietf.org/html/rfc4287
+ Atom Threading Extensions (RFC4685) is supported:
+
+ https://tools.ietf.org/html/rfc4685
+
Finally, the gzipped mbox for a thread is available for
downloading and importing into your favorite mail client: