diff options
author | Robert Hak <adiamas@rockbox.org> | 2002-08-22 03:33:33 +0000 |
---|---|---|
committer | Robert Hak <adiamas@rockbox.org> | 2002-08-22 03:33:33 +0000 |
commit | d421f5b3729367f8345c268adea2b0f7b8e30777 (patch) | |
tree | 33c0623bdd16efc12c03aa3fda7a2100a1c3e3d4 /www/txt2html.pl | |
parent | b10017e3e8fd6fdde5b61cac9b8e7af095ad6c7c (diff) | |
download | rockbox-d421f5b3729367f8345c268adea2b0f7b8e30777.tar.gz rockbox-d421f5b3729367f8345c268adea2b0f7b8e30777.zip |
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
Diffstat (limited to 'www/txt2html.pl')
-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 @@ +#!/usr/bin/perl + +# this is really a faq2html and should only be used for this purpose + +sub fixline { + $_ =~ s/\</</g; + $_ =~ s/\>/>/g; + + $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\) .\n])/\<a href=\"$1\"\>$1\<\/a\>/g; + + $_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line +} + +while(<STDIN>) { + fixline($_); + push @p, "$_"; +} + +print "<pre>\n"; +print @p; +print "</pre>\n"; + + + + |