diff options
| -rwxr-xr-x | www/txt2html.pl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/www/txt2html.pl b/www/txt2html.pl new file mode 100755 index 0000000..8e88a4c --- /dev/null +++ b/www/txt2html.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +# this is really a faq2html and should only be used for this purpose + +sub fixline { + $_ =~ s/\</</g; + $_ =~ s/\>/>/g; + + $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\) .\n])/\<a href=\"$1\"\>$1\<\/a\>/g; + + $_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line +} + +while(<STDIN>) { + fixline($_); + push @p, "$_"; +} + +print "<pre>\n"; +print @p; +print "</pre>\n"; + + + + |