summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rwxr-xr-xwww/txt2html.pl25
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
5sub fixline {
6 $_ =~ s/\</&lt;/g;
7 $_ =~ s/\>/&gt;/g;
8
9 $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\) .\n])/\<a href=\"$1\"\>$1\<\/a\>/g;
10
11 $_ =~ s/(\\|\/)$/$1&nbsp;/g; # clobber backslash on end of line
12}
13
14while(<STDIN>) {
15 fixline($_);
16 push @p, "$_";
17}
18
19print "<pre>\n";
20print @p;
21print "</pre>\n";
22
23
24
25