bagder: curl-www/docs faqparse.pl,1.7,1.8

[email protected]
Newsgroups gmane.comp.web.curl.www.cvs
Message-ID <[email protected]>
Update of /cvsroot/curl/curl-www/docs
In directory labb:/tmp/cvs-serv10000

Modified Files:
	faqparse.pl 
Log Message:
repair breakage done in my previous commit, and remove generating old-style
links with chapter numbers since we don't want them to get stuck in links
anyway


Index: faqparse.pl
===================================================================
RCS file: /cvsroot/curl/curl-www/docs/faqparse.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- faqparse.pl	9 Dec 2007 12:18:52 -0000	1.7
+++ faqparse.pl	10 Dec 2007 10:52:40 -0000	1.8
@@ -43,9 +43,9 @@
             
             next;
         }
-        if($_ =~ /([0-9]+\.[0-9]+) (.*)/) {
+        if($_ =~ /([0-9.]+\.[0-9]+) (.*)/) {
             my ($num, $phrase)=($1, $2);
-#            print "$num $phrase\n";
+    #        print STDERR "$num $phrase\n";
             $faq{$num} = $phrase;
             my $l = substr($phrase, 0, 32);
             # filter off "odd" chars
@@ -60,7 +60,7 @@
             push @toc, $num;
         }
         elsif($_ =~ /([0-9]+)\. (.*)/) {
-#            print "SECTION: $1 \"$2\"\n";
+    #        print STDERR "SECTION: $1 \"$2\"\n";
             $section[$1]=$2;
             push @secs, $2;
         }
@@ -68,6 +68,8 @@
     elsif($state == 3) {
         my $l = $_;
 
+    #    print STDERR "C: $toc[$q]\n";
+
         if($secs[$sec] && ($_ =~ /^\s*([0-9]+)\. $secs[$sec]/i)) {
             # a new section
             my $ti = $l;
@@ -78,14 +80,13 @@
             $sec++;
         }
 
-        elsif($toc[$q] && ($_ =~ /^\s*$toc[$q]/i)) {
+        elsif($toc[$q] && ($_ =~ /^ *$toc[$q]/i)) {
             # a question
             my $s=$_;
             chomp $s;
             $s =~ s/^ *(.*) */$1/;
             print "<a name=\"$link{$toc[$q]}\"></a>";
-            # we provide the older name as well to make oldish links live
-            print "<a name=\"$toc[$q]\"></a><h3>$s</h3><p>\n";
+            print "<h3>$s</h3><p>\n";
             $q++;
         }
         else {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.