]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use only 'normal' characters for html anchors
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 16 Mar 2006 16:08:41 +0000 (16:08 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 16 Mar 2006 16:08:41 +0000 (16:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@12622 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/tutorial/chapter-2.step-by-step/program2doxygen
deal.II/doc/tutorial/chapter-2.step-by-step/program2doxyplain
deal.II/doc/tutorial/chapter-2.step-by-step/program2html
deal.II/doc/tutorial/chapter-2.step-by-step/program2plain
deal.II/doc/tutorial/chapter-2.step-by-step/program2toc

index 3d675ec75a468fdc63bc32261b9347e3e58aa3e2..a183b0cd30a38700ce3b95a60c7116a0331f6efa 100644 (file)
@@ -53,8 +53,11 @@ do {
        if ( /\@sect/ ) {
           s!\@sect(\d)\{(.*)\}\s*$!<h$1>$2</h$1>!g;
           $sect_name = $2;
-          $sect_name =~ s/\s/_/g;
-          $sect_name =~ s/[\'\`]/_/g;
+
+          # for the anchor, use the name of the section but discard
+          # everything except for letters, numbers, and underscores
+          $sect_name =~ s/[^a-zA-Z0-9_]//g;
+
           $_ = "\n * <a name=\"$sect_name\"></a> \n * $_";
        }
 
index 05648e7fe8ab9838e77cd27188f13e525bbaa758..dad17123243bdf78d110ad5baf552084706f9495 100644 (file)
@@ -20,7 +20,11 @@ while (<>) {
 
           m!\@sect(\d)\{(.*)\}\s*$!;
           $sect_name = $2;
-          $sect_name =~ s/\s/_/g;
+
+          # for the anchor, use the name of the section but discard
+          # everything except for letters, numbers, and underscores
+          $sect_name =~ s/[^a-zA-Z0-9_]//g;
+
           print "\@endcode\n";
           print " <a name=\"plain-$sect_name\"></a>\n";
           print "\@code\n";
index a9c67348f025b5143516607f6ffc380ec72f579d..aa462d5920087429f1fbd06f7267caa044bbb6bc 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1999, 2000, 2001, 2002, 2005 by Wolfgang Bangerth, University of Heidelberg
+# Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006 by Wolfgang Bangerth, University of Heidelberg
 
 print "<a name=\"CommProg\"></a>\n";
 print "<h1> The commented program</h1>\n";
@@ -60,7 +60,11 @@ do {
        if ( /\@sect/ ) {
           s!\@sect(\d)\{(.*)\}\s*$!<h$1>$2</h$1>!g;
           $sect_name = $2;
-          $sect_name =~ s/\s/_/g;
+
+          # for the anchor, use the name of the section but discard
+          # everything except for letters, numbers, and underscores
+          $sect_name =~ s/[^a-zA-Z0-9_]//g;
+
           $_ = "\n<a name=\"$sect_name\"></a>" . $_;
        }
 
index 380da8b56cb40d3a0a2df96ef9a493a3c28e0a91..80dff7ac23a286e3023f039c37e64f949af02c24 100644 (file)
@@ -27,9 +27,12 @@ while (<>) {
 
           m!\@sect(\d)\{(.*)\}\s*$!;
           $sect_name = $2;
-          $sect_name =~ s/\s/_/g;
-          $_ = "\n<a name=\"plain-$sect_name\"></a>";
-          print;
+
+          # for the anchor, use the name of the section but discard
+          # everything except for letters, numbers, and underscores
+          $sect_name =~ s/[^a-zA-Z0-9_]//g;
+
+          print "\n<a name=\"plain-$sect_name\"></a>\n";
        }
     }  
 }
index 99bee597bb8fc87fdc11782091d95b8f25916909..c31726d4f3aec7ed428f5203b3501bc19c7e89e4 100644 (file)
@@ -32,7 +32,10 @@ while (<>) {
        }
 
        $reftext = $text;
-       $reftext =~ s/\s/_/g;
+
+       # for the anchor, use the name of the section but discard
+       # everything except for letters, numbers, and underscores
+       $reftext =~ s/[^a-zA-Z0-9_]//g;
        print "        <li><a href=\"#$reftext\">$text</a>\n";
 
        $level = $newlevel;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.