#!/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])/\$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 "$_"; } else { last; } } print "\n\n$line"; next; } print $_; }
$_"; my $line; while() { fixline($_); $line = $_; if($_ !~ /^A/) { print "$_"; } else { last; } } print "
\n$line"; next; } print $_; }