diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2002-08-19 15:01:42 +0000 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2002-08-19 15:01:42 +0000 |
| commit | 4d52ba710a622a5f561fbad0a47e08bfba28f33d (patch) | |
| tree | 2495955ef785f6dc4faf54964dbf6e32fe083a9a | |
| parent | 02cab124c3441ba272f586ab1e9d7cd7772e532b (diff) | |
| download | rockbox-4d52ba710a622a5f561fbad0a47e08bfba28f33d.zip rockbox-4d52ba710a622a5f561fbad0a47e08bfba28f33d.tar.gz rockbox-4d52ba710a622a5f561fbad0a47e08bfba28f33d.tar.bz2 rockbox-4d52ba710a622a5f561fbad0a47e08bfba28f33d.tar.xz | |
convert the faq more
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1807 a1c6a512-1295-4272-9138-f99709370657
| -rwxr-xr-x | www/txt2plain.pl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/www/txt2plain.pl b/www/txt2plain.pl index f460cff..ec49adb 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(<STDIN>) { $_ =~ s/\</</g; $_ =~ s/\>/>/g; - $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^).])/\<a href=\"$1\"\>$1\<\/a\>/g; + $_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\).])/\<a href=\"$1\"\>$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 "</pre>\n<a name=\"$1\"></a><p class=\"faqq\">$_"; + my $line; + while(<STDIN>) { + $line = $_; + if($_ !~ /^A/) { + print "$_"; + } + else { + last; + } + } + print "</p>\n<pre class=\"faqa\">\n$line"; + next; + } + print $_; } |