]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Treat the @item command specially. The way in the previous revision
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 26 Jun 2000 16:02:25 +0000 (16:02 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 26 Jun 2000 16:02:25 +0000 (16:02 +0000)
did not work as the brackets in the <li> item got escaped below.

git-svn-id: https://svn.dealii.org/trunk@3081 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/kdoc/src/kdocHTMLutil.pm

index 20e7268c2575d2bd8ce4d8171796bc84f9339934..18c2d3a34b3be9b1d3a4576add7640acb22f6ac0 100644 (file)
@@ -602,23 +602,20 @@ sub deref
        my $out = "";
        my $text;
 
-       # first escape @x directives. these are @x commands that do
-       # not take parameters, i.e. they do not take an argument which
-       # would either be the next word or the string in braces after
-       # the command name
-       $str =~ s/\@item/<li>/g;
-
        # escape @x commands. by using the `split' command, we get a
        # list of strings that contain either the matched command or the
        # string in between. if an element of this list matches a
        # command, then we process it further, otherwise we simply
        # copy it over to the output
-        foreach $text ( split (/(\@\w+(?:\s+.+?(?=\s)|\{.*?\}))/, $str ) ) {
+       #
+       # note the special treatment of the @item command as that does not
+       # take a parameter
+        foreach $text ( split (/(\@item|\@\w+(?:\s+.+?(?=\s)|\{.*?\}))/, $str ) ) {
                # check whether $text is an @command or the text between
                # @commands
-               if (  $text =~ /\@(\w+)(?:\s+(.+?)(?:\s|$)|\{(.*?)\})/ )   {
-                        my $command = $1;
-                       my $content = $2 . $3;
+               if (  $text =~ /\@(item)|\@(\w+)(?:\s+(.+?)(?:\s|$)|\{(.*?)\})/ )   {
+                        my $command = $1 . $2;
+                       my $content = $3 . $4;
 
                        # @ref -- cross reference
                        if ( $command eq "ref" ) {
@@ -675,6 +672,15 @@ sub deref
                            }
                        }
 
+                       # @item -- start an item in an itemized or
+                       # enumerated list. note that this is special
+                       # as @item does not take an argument, which is
+                       # the reason why we have treated it specially
+                       # above 
+                       elsif ( $command =~ /^item$/ ) { 
+                           $out .= "<li>"; 
+                       }
+
                        # unknown command. warn and copy command
                        else {
                            print "Unknown command @", $command, "\n";

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.