summaryrefslogtreecommitdiff
path: root/www/txt2plain.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-16 09:02:48 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-16 09:02:48 +0000
commit1ed48d4975632fc1b29d74fb87c87c36640daf8b (patch)
tree8f8656cfa3f578f836da3b84991c6d76f67e6f02 /www/txt2plain.pl
parent1880165e2e355e766835a28f78e17254dca80c4c (diff)
downloadrockbox-1ed48d4975632fc1b29d74fb87c87c36640daf8b.tar.gz
rockbox-1ed48d4975632fc1b29d74fb87c87c36640daf8b.zip
basic slash treatment and URL-linking added
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1779 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'www/txt2plain.pl')
-rwxr-xr-xwww/txt2plain.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/www/txt2plain.pl b/www/txt2plain.pl
index eb630acad0..f460cff301 100755
--- a/www/txt2plain.pl
+++ b/www/txt2plain.pl
@@ -5,7 +5,11 @@ while(<STDIN>) {
5 $_ =~ s/\</&lt;/g; 5 $_ =~ s/\</&lt;/g;
6 $_ =~ s/\>/&gt;/g; 6 $_ =~ s/\>/&gt;/g;
7 7
8 $_ =~ s/^$/\&nbsp;/g; 8 $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^).])/\<a href=\"$1\"\>$1\<\/a\>/g;
9
10 $_ =~ s/^$/\&nbsp;/g; # empty lines are nbsp
11 $_ =~ s/(\\|\/)$/$1&nbsp;/g; # clobber backslash on end of line
12
9 13
10 print $_; 14 print $_;
11} 15}