From 2ba3e3c698dbe4c9ef5b335d2750582272a50d04 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 26 Jun 2000 16:02:25 +0000 Subject: [PATCH] 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 --- deal.II/contrib/kdoc/src/kdocHTMLutil.pm | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) 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"; -- 2.39.5