danf: curl-www/docs faqparse.pl,1.8,1.9

[email protected] Wed, 04 Feb 2009 22:29:50 +0000
Newsgroups gmane.comp.web.curl.www.cvs
Message-ID <[email protected]>
Update of /cvsroot/curl/curl-www/docs
In directory labb:/tmp/cvs-serv30825

Modified Files:
	faqparse.pl 
Log Message:
Fixed a few problems with quoting. Added italicised text.


Index: faqparse.pl
===================================================================
RCS file: /cvsroot/curl/curl-www/docs/faqparse.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- faqparse.pl	10 Dec 2007 10:52:40 -0000	1.8
+++ faqparse.pl	4 Feb 2009 22:29:42 -0000	1.9
@@ -47,6 +47,9 @@
             my ($num, $phrase)=($1, $2);
     #        print STDERR "$num $phrase\n";
             $faq{$num} = $phrase;
+            $faq{$num} =~ s/&/&amp;/g;
+            $faq{$num} =~ s/\</&lt;/g;
+            $faq{$num} =~ s/\>/&gt;/g;
             my $l = substr($phrase, 0, 32);
             # filter off "odd" chars
             $l =~ s/[^a-z0-9A-Z]/_/g;
@@ -84,15 +87,20 @@
             # a question
             my $s=$_;
             chomp $s;
+            $s =~ s/&/&amp;/g;
+            $s =~ s/\</&lt;/g;
+            $s =~ s/\>/&gt;/g;
             $s =~ s/^ *(.*) */$1/;
             print "<a name=\"$link{$toc[$q]}\"></a>";
             print "<h3>$s</h3><p>\n";
             $q++;
         }
         else {
-            my $l = $_;
-            $l = s/\</&lt;/g;
-            $l = s/\</&gt;/g;
+            s/&/&amp;/g;
+            s/\</&lt;/g;
+            s/\>/&gt;/g;
+            # Emphasize _underlined_ words
+            s/\b_([[:alnum:]]+)_\b/<em>$1<\/em>/g;
 
             if($_ =~ /^     /) {
                 # five or more initial spaces, use <pre>
@@ -105,7 +113,7 @@
                     print "</pre>\n";
                     undef @pre;
                 }
-                $l = s/((http|ftp):\/\/([a-z0-9.\/_%-?]*[a-z\/]))/<a href=\"$2:\/\/$3\">$1<\/a>/g;
+                s/((http|ftp):\/\/([a-z0-9.\/_%-?]*[a-z\/]))/<a href=\"$2:\/\/$3\">$1<\/a>/g;
                 
                 # prevent many blanks
                 my $show = $_;