From 54ed3d6ce1c54797a006549c784cbebdff6a4024 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 19 Aug 2002 15:50:13 +0000 Subject: fix links within A-sections too and improve the parser somewhat git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1808 a1c6a512-1295-4272-9138-f99709370657 --- www/txt2plain.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/www/txt2plain.pl b/www/txt2plain.pl index ec49adb..7264052 100755 --- a/www/txt2plain.pl +++ b/www/txt2plain.pl @@ -2,22 +2,28 @@ # this is really a faq2html and should only be used for this purpose -while() { - +sub fixline { $_ =~ s/\/>/g; - $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\).])/\$1\<\/a\>/g; + $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\) .\n])/\$1\<\/a\>/g; $_ =~ s/^$/\ /g; # empty lines are nbsp $_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line +} +while() { + + fixline($_); # detect and mark Q-sections if( $_ =~ /^Q(\d*)/) { print "\n

$_"; my $line; while() { + + fixline($_); + $line = $_; if($_ !~ /^A/) { print "$_"; -- cgit v1.1