texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7430] parsetexi update


From: gavinsmith0123
Subject: [7430] parsetexi update
Date: Sun, 2 Oct 2016 16:47:30 +0000 (UTC)

Revision: 7430
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7430
Author:   gavin
Date:     2016-10-02 16:47:29 +0000 (Sun, 02 Oct 2016)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/tp/parsetexi/Parsetexi.pm
    trunk/tp/parsetexi/api.c

Modified: trunk/tp/parsetexi/Parsetexi.pm
===================================================================
--- trunk/tp/parsetexi/Parsetexi.pm     2016-10-02 16:13:29 UTC (rev 7429)
+++ trunk/tp/parsetexi/Parsetexi.pm     2016-10-02 16:47:29 UTC (rev 7430)
@@ -215,18 +215,28 @@
   # "(texinfo)Info Format Preamble" and some other nodes in
   # doc/texinfo.texi.  Avoid referencing it which would create
   # it by mistake, which would cause problems in Structuring.pm.
+  #
+  # Also, check for menu elements under both the node element and the
+  # sectioning element.  This is for malformed input with a @menu between
+  # the two commands.
 
   my $contents;
-  if (defined $node->{'extra'}{'associated_section'}) {
-    $contents = $node->{'extra'}{'associated_section'}->{'contents'};
-  } else {
+
+  if ($node->{'contents'}) {
     $contents = $node->{'contents'};
+    foreach my $child (@{$contents}) {
+      if ($child->{'cmdname'} and $child->{'cmdname'} eq 'menu') {
+        push @{$node->{'menus'}}, $child;
+      }
+    }
   }
-    
 
-  foreach my $child (@{$contents}) {
-    if ($child->{'cmdname'} and $child->{'cmdname'} eq 'menu') {
-      push @{$node->{'menus'}}, $child;
+  if (defined $node->{'extra'}{'associated_section'}) {
+    $contents = $node->{'extra'}{'associated_section'}->{'contents'};
+    foreach my $child (@{$contents}) {
+      if ($child->{'cmdname'} and $child->{'cmdname'} eq 'menu') {
+        push @{$node->{'menus'}}, $child;
+      }
     }
   }
 }

Modified: trunk/tp/parsetexi/api.c
===================================================================
--- trunk/tp/parsetexi/api.c    2016-10-02 16:13:29 UTC (rev 7429)
+++ trunk/tp/parsetexi/api.c    2016-10-02 16:47:29 UTC (rev 7430)
@@ -260,6 +260,7 @@
       || e->cmd == CM_TeX
       || e->type == ET_elided
       || e->type == ET_elided_block
+      || e->type == ET_preformatted
       || (command_flags(e) & CF_root)
       || (command_data(e->cmd).flags & CF_brace
           && (command_data(e->cmd).data >= 0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]