From 82ad8fc5931c086e6fdd5113336f2c71eaf18569 Mon Sep 17 00:00:00 2001 From: "rginda%netscape.com" Date: Sat, 4 Mar 2000 05:07:20 +0000 Subject: [PATCH] Modify parse_devedge_doc.pl so it didn't lose the description after the first note (this was bad.) Madify parse_apidoc.pl to warn (not croak) on empty tags, and to be able to deal with duplicate tags. --- webtools/apidoc/parse_apidoc.pl | 6 ++++-- webtools/apidoc/parse_devedge_doc.pl | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/webtools/apidoc/parse_apidoc.pl b/webtools/apidoc/parse_apidoc.pl index 5f1b59791f4..ccef7840511 100644 --- a/webtools/apidoc/parse_apidoc.pl +++ b/webtools/apidoc/parse_apidoc.pl @@ -375,7 +375,9 @@ sub EndTag { if (grep(/^$tagname$/, @CDATA_TAGS)) { $iscontainer = 1; if ($pending_text eq "") { - $expat->xpcroak ("Empty container '$tagname'."); + print STDERR "WARNING: Empty container '$tagname' at line " . + $expat->current_line . " ignored.\n"; + #$expat->xpcroak ("Empty container '$tagname'."); } } @@ -492,7 +494,7 @@ sub EndTag { } elsif ($tagname eq $TAGS[$FOOT]) { $user_foot .= $result_text; } else { - $c->{$tagname} = $result_text; + $c->{$tagname} .= $result_text; } $pending_text = pop (@text_stack); diff --git a/webtools/apidoc/parse_devedge_doc.pl b/webtools/apidoc/parse_devedge_doc.pl index 1a429461cff..114687cece6 100644 --- a/webtools/apidoc/parse_devedge_doc.pl +++ b/webtools/apidoc/parse_devedge_doc.pl @@ -62,7 +62,7 @@ my @TAGS = ("API", "ENTRY", "TYPE", "SUMMARY", "SYNTAX", "PARAM", "RETVAL", my $NAMESPACE = ""; # "APIDOC"; -my $TAB = " "; +my $TAB = " "; my $indent_pfx = ""; die ("I said, dont use this script! Don't you read the comments?\n"); @@ -190,9 +190,10 @@ sub parse_entry { &open_container ($TAGS[$mode]); } elsif (($mode == $NOTE) && ($line =~ /<\/BLOCKQUOTE>/)) { # note over - $partialline = '

'; - # dirty little hack to get it to execute the - # 'figure out next mode' logic above. + output ("

\n"); + &close_container ($TAGS[$mode]); + $mode = $DESCRIPTION; + &open_container ($TAGS[$mode]); } elsif (($mode == $SYNTAX) || ($mode == $EXAMPLE)) { if (($mode == $SYNTAX) && ($line =~ /(.*)/)) { @@ -271,10 +272,11 @@ sub parse_entry { } elsif ($mode == $SEE_ALSO) { if ($line =~ /(.*)<\/P>/) { my $list = &fixup ($1); - my @refs = split(/,\s*/, $list); + my @refs = split(/\s*,\s*/, $list); for (@refs) { if ($_) { - &tag ($TAGS[$mode], "value", $_); + $_ =~ /^\s*(\S+)\s*$/; + &tag ($TAGS[$mode], "value", $1); } } $mode = $COMPLETED;