]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: provide text/help/#search anchor
authorEric Wong <e@80x24.org>
Mon, 29 Aug 2022 09:26:42 +0000 (09:26 +0000)
committerEric Wong <e@80x24.org>
Mon, 29 Aug 2022 19:05:52 +0000 (19:05 +0000)
This allows jumping to the appropriate section of the "help"
from under the dfblob textarea search.

lib/PublicInbox/View.pm
lib/PublicInbox/WwwText.pm

index 86f4a4672590364ecafa85f92176980f242fff93..f29fff50d63832376f74808f6385983291262cc1 100644 (file)
@@ -849,7 +849,7 @@ action=$upfx
 href=#t>this message</a>:
 <textarea name=q cols=${\COLS} rows=$rows>$q</textarea>
 <input type=submit value=search
-/>\t(<a href=${upfx}_/text/help/>help</a>)</pre></form>
+/>\t(<a href=${upfx}_/text/help/#search>help</a>)</pre></form>
 EOM
        }
        if ($ctx->{ibx}->over) {
index 3f840c447fdf37c3dc3cec8eae518840524d1a76..1a0bb07aab4da8562b12976e8c8cad77ab3d6321 100644 (file)
@@ -67,6 +67,7 @@ sub get_text {
                $txt = ascii_html($txt);
        }
        $txt = '<pre>' . $l->linkify_2($txt) . '</pre>';
+       $txt =~ s!^search$!<a\nid=search>search</a>!sm;
        $txt =~ s!\bPOP3\b!<a\nid=pop3>POP3</a>!;
        $txt =~ s!\b(Newsgroups?)\b!<a\nid=nntp>$1</a>!;
        $txt =~ s!\bIMAP\b!<a\nid=imap>IMAP</a>!;