diff options
Diffstat (limited to 'www')
-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 0000000000..8e88a4c1fa --- /dev/null +++ b/www/txt2html.pl | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # this is really a faq2html and should only be used for this purpose | ||
4 | |||
5 | sub fixline { | ||
6 | $_ =~ s/\</</g; | ||
7 | $_ =~ s/\>/>/g; | ||
8 | |||
9 | $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\) .\n])/\<a href=\"$1\"\>$1\<\/a\>/g; | ||
10 | |||
11 | $_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line | ||
12 | } | ||
13 | |||
14 | while(<STDIN>) { | ||
15 | fixline($_); | ||
16 | push @p, "$_"; | ||
17 | } | ||
18 | |||
19 | print "<pre>\n"; | ||
20 | print @p; | ||
21 | print "</pre>\n"; | ||
22 | |||
23 | |||
24 | |||
25 | |||