54ed3d6ce1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1808 a1c6a512-1295-4272-9138-f99709370657
40 lines
832 B
Perl
Executable file
40 lines
832 B
Perl
Executable file
#!/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/^$/\ /g; # empty lines are nbsp
|
|
$_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line
|
|
}
|
|
|
|
while(<STDIN>) {
|
|
|
|
fixline($_);
|
|
|
|
# detect and mark Q-sections
|
|
if( $_ =~ /^Q(\d*)/) {
|
|
print "</pre>\n<a name=\"$1\"></a><p class=\"faqq\">$_";
|
|
my $line;
|
|
while(<STDIN>) {
|
|
|
|
fixline($_);
|
|
|
|
$line = $_;
|
|
if($_ !~ /^A/) {
|
|
print "$_";
|
|
}
|
|
else {
|
|
last;
|
|
}
|
|
}
|
|
print "</p>\n<pre class=\"faqa\">\n$line";
|
|
next;
|
|
}
|
|
|
|
print $_;
|
|
}
|