From 686af920fb32cc03e357be58d096d6b941aafa27 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 16 Mar 2006 16:08:41 +0000 Subject: [PATCH] Use only 'normal' characters for html anchors git-svn-id: https://svn.dealii.org/trunk@12622 0785d39b-7218-0410-832d-ea1e28bc413d --- .../doc/tutorial/chapter-2.step-by-step/program2doxygen | 7 +++++-- .../tutorial/chapter-2.step-by-step/program2doxyplain | 6 +++++- deal.II/doc/tutorial/chapter-2.step-by-step/program2html | 8 ++++++-- .../doc/tutorial/chapter-2.step-by-step/program2plain | 9 ++++++--- deal.II/doc/tutorial/chapter-2.step-by-step/program2toc | 5 ++++- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxygen b/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxygen index 3d675ec75a..a183b0cd30 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxygen +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxygen @@ -53,8 +53,11 @@ do { if ( /\@sect/ ) { s!\@sect(\d)\{(.*)\}\s*$!$2!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 * \n * $_"; } diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxyplain b/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxyplain index 05648e7fe8..dad1712324 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxyplain +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/program2doxyplain @@ -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 " \n"; print "\@code\n"; diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/program2html b/deal.II/doc/tutorial/chapter-2.step-by-step/program2html index a9c67348f0..aa462d5920 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/program2html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/program2html @@ -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 "\n"; print "

The commented program

\n"; @@ -60,7 +60,11 @@ do { if ( /\@sect/ ) { s!\@sect(\d)\{(.*)\}\s*$!$2!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" . $_; } diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain b/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain index 380da8b56c..80dff7ac23 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain @@ -27,9 +27,12 @@ while (<>) { m!\@sect(\d)\{(.*)\}\s*$!; $sect_name = $2; - $sect_name =~ s/\s/_/g; - $_ = "\n"; - 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\n"; } } } diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/program2toc b/deal.II/doc/tutorial/chapter-2.step-by-step/program2toc index 99bee597bb..c31726d4f3 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/program2toc +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/program2toc @@ -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 "
  • $text\n"; $level = $newlevel; -- 2.39.5