From 4d52ba710a622a5f561fbad0a47e08bfba28f33d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 19 Aug 2002 15:01:42 +0000 Subject: [PATCH] convert the faq more git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1807 a1c6a512-1295-4272-9138-f99709370657 --- www/txt2plain.pl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/www/txt2plain.pl b/www/txt2plain.pl index f460cff301..ec49adbcdb 100755 --- a/www/txt2plain.pl +++ b/www/txt2plain.pl @@ -1,15 +1,34 @@ #!/usr/bin/perl +# this is really a faq2html and should only be used for this purpose + while() { $_ =~ s/\/>/g; - $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^).])/\$1\<\/a\>/g; + $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\).])/\$1\<\/a\>/g; $_ =~ s/^$/\ /g; # empty lines are nbsp $_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line + # detect and mark Q-sections + if( $_ =~ /^Q(\d*)/) { + print "\n

$_"; + my $line; + while() { + $line = $_; + if($_ !~ /^A/) { + print "$_"; + } + else { + last; + } + } + print "

\n
\n$line";
+        next;
+    }
+
     print $_;
 }