rockbox/www/txt2html.pl
Robert Hak d421f5b372 initial creation.. file is to convert plain text to html
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1910 a1c6a512-1295-4272-9138-f99709370657
2002-08-22 03:33:33 +00:00

25 lines
407 B
Perl
Executable file

#!/usr/bin/perl
# this is really a faq2html and should only be used for this purpose
sub fixline {
$_ =~ s/\</&lt;/g;
$_ =~ s/\>/&gt;/g;
$_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\) .\n])/\<a href=\"$1\"\>$1\<\/a\>/g;
$_ =~ s/(\\|\/)$/$1&nbsp;/g; # clobber backslash on end of line
}
while(<STDIN>) {
fixline($_);
push @p, "$_";
}
print "<pre>\n";
print @p;
print "</pre>\n";