]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www_text: add #nntp, #pop3, and #imap anchors to help HTML
authorEric Wong <e@80x24.org>
Wed, 10 Aug 2022 07:40:29 +0000 (07:40 +0000)
committerEric Wong <e@80x24.org>
Wed, 10 Aug 2022 15:56:09 +0000 (15:56 +0000)
This will make it easier to link to these sections in
3rd-party documentation.

lib/PublicInbox/WwwText.pm

index 369328eef6f717bfd8712d45ca5b5fcdc2727a5c..320f0d840f9e92d96486d7092d899cd9dba4440c 100644 (file)
@@ -67,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);
 }