From: Eric Wong <e@80x24.org>
Date: Mon, 22 Dec 2014 01:37:58 +0000 (+0000)
Subject: Documentation/txt2pre: support #fragments and ftp://
X-Git-Tag: v1.0.0~1096
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=7f35ce53a0183aafc450faded89954f784bf835a;p=public-inbox.git

Documentation/txt2pre: support #fragments and ftp://

Occasionally we'll use these for links.
---

diff --git a/Documentation/txt2pre b/Documentation/txt2pre
index f84f9c06..0384a1d0 100755
--- a/Documentation/txt2pre
+++ b/Documentation/txt2pre
@@ -17,7 +17,7 @@ my ($title) = ($str =~ /\A([^\n]+)/);
 # temporarily swap &gt; for escape so our s!! to add href works.
 # there's probably a way to do this with only a single s!! ...
 $str =~ s!&gt;!\e!g;
-$str =~ s!\b(https?://[\w+\+\&\?\.\%\;/-]+)!<a\nhref="$1"\n>$1</a>!g;
+$str =~ s!\b((ftp|https?)://[\w+\+\&\?\.\%\;/#-]+)!<a\nhref="$1"\n>$1</a>!g;
 $str =~ s!\e!&gt;!g; # swap escapes back to &gt;
 
 print '<html><head>',