From: wolf Date: Mon, 26 Jun 2000 16:02:25 +0000 (+0000) Subject: Treat the @item command specially. The way in the previous revision X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ba3e3c698dbe4c9ef5b335d2750582272a50d04;p=dealii-svn.git Treat the @item command specially. The way in the previous revision did not work as the brackets in the
  • item got escaped below. git-svn-id: https://svn.dealii.org/trunk@3081 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/kdoc/src/kdocHTMLutil.pm b/deal.II/contrib/kdoc/src/kdocHTMLutil.pm index 20e7268c25..18c2d3a34b 100644 --- a/deal.II/contrib/kdoc/src/kdocHTMLutil.pm +++ b/deal.II/contrib/kdoc/src/kdocHTMLutil.pm @@ -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/
  • /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 .= "
  • "; + } + # unknown command. warn and copy command else { print "Unknown command @", $command, "\n";