]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwText.pm
www_text: add #nntp, #pop3, and #imap anchors to help HTML
[public-inbox.git] / lib / PublicInbox / WwwText.pm
index 2937c3336c3fd40b8d7809b7ad116eab26261d9b..320f0d840f9e92d96486d7092d899cd9dba4440c 100644 (file)
@@ -38,11 +38,7 @@ sub get_text {
        }
        my $env = $ctx->{env};
        if ($raw) {
-               if ($code == 200) {
-                       my $gzf = gzf_maybe($hdr, $env);
-                       $txt = $gzf->translate($txt);
-                       $txt .= $gzf->zflush;
-               }
+               $txt = gzf_maybe($hdr, $env)->zflush($txt) if $code == 200;
                $hdr->[3] = length($txt);
                return [ $code, $hdr, [ $txt ] ]
        }
@@ -71,6 +67,9 @@ sub get_text {
                $txt = ascii_html($txt);
        }
        $txt = '<pre>' . $l->linkify_2($txt) . '</pre>';
+       $txt =~ s!\bPOP3\b!<a\nid=pop3>POP3</a>!;
+       $txt =~ s!\bNewsgroups\b!<a\nid=nntp>Newsgroups</a>!;
+       $txt =~ s!\bIMAP\b!<a\nid=imap>IMAP</a>!;
        PublicInbox::WwwStream::html_oneshot($ctx, $code, \$txt);
 }