rockbox/www/txt2plain.pl
Daniel Stenberg 1ed48d4975 basic slash treatment and URL-linking added
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1779 a1c6a512-1295-4272-9138-f99709370657
2002-08-16 09:02:48 +00:00

15 lines
298 B
Perl
Executable file

#!/usr/bin/perl
while(<STDIN>) {
$_ =~ s/\</&lt;/g;
$_ =~ s/\>/&gt;/g;
$_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^).])/\<a href=\"$1\"\>$1\<\/a\>/g;
$_ =~ s/^$/\&nbsp;/g; # empty lines are nbsp
$_ =~ s/(\\|\/)$/$1&nbsp;/g; # clobber backslash on end of line
print $_;
}