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 $_;
 }