texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: @nodedescription parsing in texi1any


From: Patrice Dumas
Subject: branch master updated: @nodedescription parsing in texi1any
Date: Sun, 23 Jul 2023 13:08:18 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new d37cc828fc @nodedescription parsing in texi1any
d37cc828fc is described below

commit d37cc828fc2af7e48bc9cf4f3c0f367f2ec5c29f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jul 23 18:39:57 2023 +0200

    @nodedescription parsing in texi1any
    
    * tp/Texinfo/ParserNonXS.pm (%contain_full_text_commands)
    (_handle_line_command), tp/Texinfo/XS/parsetexi/handle_commands.c
    (handle_line_command), tp/Texinfo/XS/parsetexi/parser.c
    (check_valid_nesting), tp/Texinfo/command_data.txt: parse
    @nodedescription, adding extra information about the current node in
    and in the current node too in extra node_description.
    
    * tp/t/test_utils.pl (@contents_keys): add node_description.
    
    * tp/Makefile.tres, tp/t/08misc_commands.t (nodedescription): test
    parsing of @nodedescription.
---
 ChangeLog                                     |  16 +
 tp/Makefile.tres                              |   1 +
 tp/Texinfo/ParserNonXS.pm                     |  34 +-
 tp/Texinfo/XS/parsetexi/command_ids.h         |   1 +
 tp/Texinfo/XS/parsetexi/convert.c             |   7 +-
 tp/Texinfo/XS/parsetexi/handle_commands.c     |  17 +-
 tp/Texinfo/XS/parsetexi/parser.c              |   3 +-
 tp/Texinfo/command_data.txt                   |   1 +
 tp/t/08misc_commands.t                        |  14 +
 tp/t/results/misc_commands/nodedescription.pl | 524 ++++++++++++++++++++++++++
 tp/t/test_utils.pl                            |   3 +-
 11 files changed, 609 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d341423542..f0cf7eec75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,22 @@
        gcc error 'a label can only be part of a statement and a
        declaration is not a statement'.
 
+2023-07-23  Patrice Dumas  <pertusus@free.fr>
+
+       @nodedescription parsing in texi1any
+
+       * tp/Texinfo/ParserNonXS.pm (%contain_full_text_commands)
+       (_handle_line_command), tp/Texinfo/XS/parsetexi/handle_commands.c
+       (handle_line_command), tp/Texinfo/XS/parsetexi/parser.c
+       (check_valid_nesting), tp/Texinfo/command_data.txt: parse
+       @nodedescription, adding extra information about the current node in
+       and in the current node too in extra node_description.
+
+       * tp/t/test_utils.pl (@contents_keys): add node_description.
+
+       * tp/Makefile.tres, tp/t/08misc_commands.t (nodedescription): test
+       parsing of @nodedescription.
+
 2023-07-23  Patrice Dumas  <pertusus@free.fr>
 
        * doc/tp_api/Makefile.am (AM_MAKEINFOFLAGS): add the
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index d027ad055a..76926e59ca 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1451,6 +1451,7 @@ test_files_generated_list = 
$(test_tap_files_generated_list) \
   t/results/misc_commands/kbdinputstyle_in_table.pl \
   t/results/misc_commands/many_lines.pl \
   t/results/misc_commands/no_empty_line_between_headings.pl \
+  t/results/misc_commands/nodedescription.pl \
   t/results/misc_commands/noindent_after_smallexample.pl \
   t/results/misc_commands/noindent_empty_para.pl \
   t/results/misc_commands/noindent_in_paragraph.pl \
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index e7839cd46e..99d2b87353 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -455,7 +455,8 @@ foreach my $brace_command (keys (%brace_commands)) {
     $contain_full_text_commands{$brace_command} = 1;
   }
 }
-foreach my $line_command ('center', 'exdent', 'item', 'itemx') {
+foreach my $line_command ('center', 'exdent', 'item', 'itemx',
+                          'nodedescription') {
   $contain_full_text_commands{$line_command} = 1;
 }
 
@@ -3410,12 +3411,14 @@ sub _in_include($)
   return 0;
 }
 
-# Used for file names and index sort strings to allow including the special
-# Texinfo characters but not other command nor element type.
+# Convert the contents of $E to plain text.  Suitable for specifying a file
+# name containing an at sign or braces, but no other commands nor element
+# types.  Returns $SUPERFLUOUS_ARG if the $E contains other commands or element
+# types.
 sub _convert_to_text {
   my $e = shift;
 
-  my ($text,  $superfluous_arg) = ('', 0);
+  my ($text, $superfluous_arg) = ('', 0);
 
   return ($text, $superfluous_arg)
     unless($e->{'contents'});
@@ -5535,7 +5538,24 @@ sub _handle_line_command($$$$$$)
       $command_e->{'source_info'} = $source_info;
     } else {
       $command_e = { 'cmdname' => $command, 'source_info' => $source_info };
-      if ($command eq 'subentry') {
+      if ($command eq 'nodedescription') {
+        if ($self->{'current_node'}) {
+          $command_e->{'extra'} = {} if (!defined($command_e->{'extra'}));
+          $command_e->{'extra'}->{'element_node'} = $self->{'current_node'};
+          if ($self->{'current_node'}->{'extra'}
+              and $self->{'current_node'}->{'extra'}->{'node_description'}) {
+            $self->_line_warn(__("multiple node descriptions"), $source_info);
+          } else {
+            $self->{'current_node'}->{'extra'} = {}
+              if (!$self->{'current_node'}->{'extra'});
+            $self->{'current_node'}->{'extra'}->{'node_description'}
+              = $command_e;
+          }
+        } else {
+          $self->_line_warn(__("\@nodedescription outside of any node"),
+                            $source_info);
+        }
+      } elsif ($command eq 'subentry') {
         my $parent = $current->{'parent'};
         if (!_is_index_element($self, $parent)) {
           $self->_line_warn(
@@ -8811,7 +8831,7 @@ X<Texinfo tree element extra key>
 
 The node element in the parsed tree containing the element.
 Set for @-commands elements that have an associated
-index entry.
+index entry and for C<@nodedescription>.
 
 =item element_region
 
@@ -9030,6 +9050,8 @@ An I<associated_section> key holds the tree element of the
 sectioning command that follows the node.  An I<node_preceding_part>
 key holds the tree element of the C<@part> that precedes the node,
 if there is no sectioning command between the C<@part> and the node.
+A I<node_description> key holds the first C<@nodedescription> associated
+to the node.
 
 A node containing a menu have a I<menus> key which refers to an array of
 references to menu elements occuring in the node.
diff --git a/tp/Texinfo/XS/parsetexi/command_ids.h 
b/tp/Texinfo/XS/parsetexi/command_ids.h
index a4250f63da..f360ddb3a8 100644
--- a/tp/Texinfo/XS/parsetexi/command_ids.h
+++ b/tp/Texinfo/XS/parsetexi/command_ids.h
@@ -279,6 +279,7 @@ CM_minus,
 CM_multitable,
 CM_need,
 CM_node,
+CM_nodedescription,
 CM_noindent,
 CM_novalidate,
 CM_o,
diff --git a/tp/Texinfo/XS/parsetexi/convert.c 
b/tp/Texinfo/XS/parsetexi/convert.c
index f8cc69e510..081f995494 100644
--- a/tp/Texinfo/XS/parsetexi/convert.c
+++ b/tp/Texinfo/XS/parsetexi/convert.c
@@ -226,10 +226,11 @@ convert_contents_to_texinfo (ELEMENT *e)
   return result;
 }
 
-/* Very stripped-down version of Texinfo::Convert::Text.
+/*
    Convert the contents of E to plain text.  Suitable for specifying a file
-   name containing an at sign or braces.  Set *SUPERFLUOUS_ARG if the contents
-   of E are too complicated to convert properly. */
+   name containing an at sign or braces, but no other commands nor element
+   types.  Set *SUPERFLUOUS_ARG if the E contains other commands or element
+   types. */
 char *
 convert_to_text (ELEMENT *e, int *superfluous_arg)
 {
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index e7ac2b14c8..819df0e787 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -743,7 +743,22 @@ handle_line_command (ELEMENT *current, char **line_inout,
           command_e->cmd = cmd;
           command_e->source_info = current_source_info;
 
-          if (cmd == CM_subentry)
+          if (cmd == CM_nodedescription)
+            {
+              if (current_node)
+                {
+                  KEY_PAIR *k = lookup_extra (current_node, 
"node_description");
+                  if (k && k->value)
+                    line_warn ("multiple node descriptions");
+                  else
+                    add_extra_element (current_node, "node_description",
+                                       command_e);
+                  add_extra_element (command_e, "element_node", current_node);
+                }
+              else
+                line_warn ("@nodedescription outside of any node");
+            }
+          else if (cmd == CM_subentry)
             {
               long level = 1;
               ELEMENT *parent = current->parent;
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 485af32876..28e442008a 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -1188,7 +1188,8 @@ check_valid_nesting (ELEMENT *current, enum command_id 
cmd)
            || outer == CM_center
            || outer == CM_exdent
            || outer == CM_item
-           || outer == CM_itemx)
+           || outer == CM_itemx
+           || outer == CM_nodedescription)
     {
       /* Start by checking if the command is allowed inside a "full text 
          command" - this is the most permissive. */
diff --git a/tp/Texinfo/command_data.txt b/tp/Texinfo/command_data.txt
index a6f8c99715..fed55bfd2a 100644
--- a/tp/Texinfo/command_data.txt
+++ b/tp/Texinfo/command_data.txt
@@ -255,6 +255,7 @@ exdent                  line,formatted_line,close_paragraph 
           LINE_line
 # or nobrace skipspace, depending on the context
 item_LINE               
line,formatted_line,close_paragraph,contain_basic_inline    LINE_line
 itemx                   
line,formatted_line,close_paragraph,contain_basic_inline    LINE_line
+nodedescription         line,close_paragraph                               
LINE_line
 # in index entries
 subentry                line,in_index,contain_basic_inline          LINE_line
 # for printed output.  @vskip 0pt plus 1filll
diff --git a/tp/t/08misc_commands.t b/tp/t/08misc_commands.t
index d1eb5ba221..eb1a5e8d13 100644
--- a/tp/t/08misc_commands.t
+++ b/tp/t/08misc_commands.t
@@ -342,6 +342,20 @@ aaa
 @center @ref{Top, ,title
 very long}
 ', {'full_document' => 1}],
+['nodedescription',
+'@nodedescription out of any node
+
+@node Top
+@top top
+
+@node chap
+@chapter Chapter
+
+@nodedescription @emph{first description} of chapter
+
+@nodedescription second description @
+  of chapter
+'],
 ['footnote_in_center',
 '@center Centered text with a footnote@footnote{This footnote
 shows an important feature of the centered text.
diff --git a/tp/t/results/misc_commands/nodedescription.pl 
b/tp/t/results/misc_commands/nodedescription.pl
new file mode 100644
index 0000000000..489ddcb1a3
--- /dev/null
+++ b/tp/t/results/misc_commands/nodedescription.pl
@@ -0,0 +1,524 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'nodedescription'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'text' => 'out of any node'
+                }
+              ],
+              'info' => {
+                'spaces_after_argument' => {
+                  'text' => '
+'
+                }
+              },
+              'type' => 'line_arg'
+            }
+          ],
+          'cmdname' => 'nodedescription',
+          'info' => {
+            'spaces_before_argument' => {
+              'text' => ' '
+            }
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 1,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'type' => 'before_node_section'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'Top'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'extra' => {
+        'normalized' => 'Top'
+      },
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 3,
+        'macro' => ''
+      }
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'top'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'top',
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {},
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 4,
+        'macro' => ''
+      }
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'chap'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'extra' => {
+        'node_description' => {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'args' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => 'first description'
+                        }
+                      ],
+                      'type' => 'brace_command_arg'
+                    }
+                  ],
+                  'cmdname' => 'emph',
+                  'source_info' => {
+                    'file_name' => '',
+                    'line_nr' => 9,
+                    'macro' => ''
+                  }
+                },
+                {
+                  'text' => ' of chapter'
+                }
+              ],
+              'info' => {
+                'spaces_after_argument' => {
+                  'text' => '
+'
+                }
+              },
+              'type' => 'line_arg'
+            }
+          ],
+          'cmdname' => 'nodedescription',
+          'extra' => {
+            'element_node' => {}
+          },
+          'info' => {
+            'spaces_before_argument' => {
+              'text' => ' '
+            }
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 9,
+            'macro' => ''
+          }
+        },
+        'normalized' => 'chap'
+      },
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 6,
+        'macro' => ''
+      }
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'Chapter'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'chapter',
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {},
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'text' => 'second description '
+                },
+                {
+                  'cmdname' => '
+'
+                }
+              ],
+              'type' => 'line_arg'
+            }
+          ],
+          'cmdname' => 'nodedescription',
+          'extra' => {
+            'element_node' => {}
+          },
+          'info' => {
+            'spaces_before_argument' => {
+              'text' => ' '
+            }
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 11,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '  ',
+          'type' => 'spaces_before_paragraph'
+        },
+        {
+          'contents' => [
+            {
+              'text' => 'of chapter
+'
+            }
+          ],
+          'type' => 'paragraph'
+        }
+      ],
+      'extra' => {},
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 7,
+        'macro' => ''
+      }
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'nodedescription'}{'contents'}[3]{'extra'}{'node_description'}{'extra'}{'element_node'}
 = $result_trees{'nodedescription'}{'contents'}[3];
+$result_trees{'nodedescription'}{'contents'}[4]{'contents'}[1] = 
$result_trees{'nodedescription'}{'contents'}[3]{'extra'}{'node_description'};
+$result_trees{'nodedescription'}{'contents'}[4]{'contents'}[3]{'extra'}{'element_node'}
 = $result_trees{'nodedescription'}{'contents'}[3];
+
+$result_texis{'nodedescription'} = '@nodedescription out of any node
+
+@node Top
+@top top
+
+@node chap
+@chapter Chapter
+
+@nodedescription @emph{first description} of chapter
+
+@nodedescription second description @
+  of chapter
+';
+
+
+$result_texts{'nodedescription'} = '
+top
+***
+
+1 Chapter
+*********
+
+
+of chapter
+';
+
+$result_sectioning{'nodedescription'} = {
+  'structure' => {
+    'section_childs' => [
+      {
+        'cmdname' => 'top',
+        'extra' => {
+          'associated_node' => {
+            'cmdname' => 'node',
+            'extra' => {
+              'normalized' => 'Top'
+            },
+            'structure' => {}
+          }
+        },
+        'structure' => {
+          'section_childs' => [
+            {
+              'cmdname' => 'chapter',
+              'extra' => {
+                'associated_node' => {
+                  'cmdname' => 'node',
+                  'extra' => {
+                    'normalized' => 'chap'
+                  },
+                  'structure' => {}
+                }
+              },
+              'structure' => {
+                'section_level' => 1,
+                'section_number' => 1,
+                'section_up' => {},
+                'toplevel_prev' => {},
+                'toplevel_up' => {}
+              }
+            }
+          ],
+          'section_level' => 0,
+          'section_up' => {}
+        }
+      }
+    ],
+    'section_level' => -1
+  }
+};
+$result_sectioning{'nodedescription'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
 = $result_sectioning{'nodedescription'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'nodedescription'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_prev'}
 = $result_sectioning{'nodedescription'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'nodedescription'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_up'}
 = $result_sectioning{'nodedescription'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'nodedescription'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
 = $result_sectioning{'nodedescription'};
+
+$result_nodes{'nodedescription'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'associated_section' => {
+      'cmdname' => 'top',
+      'extra' => {},
+      'structure' => {}
+    },
+    'normalized' => 'Top'
+  },
+  'structure' => {
+    'node_next' => {
+      'cmdname' => 'node',
+      'extra' => {
+        'associated_section' => {
+          'cmdname' => 'chapter',
+          'extra' => {},
+          'structure' => {
+            'section_number' => 1
+          }
+        },
+        'normalized' => 'chap'
+      },
+      'structure' => {
+        'node_prev' => {},
+        'node_up' => {}
+      }
+    }
+  }
+};
+$result_nodes{'nodedescription'}{'structure'}{'node_next'}{'structure'}{'node_prev'}
 = $result_nodes{'nodedescription'};
+$result_nodes{'nodedescription'}{'structure'}{'node_next'}{'structure'}{'node_up'}
 = $result_nodes{'nodedescription'};
+
+$result_menus{'nodedescription'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top'
+  },
+  'structure' => {}
+};
+
+$result_errors{'nodedescription'} = [
+  {
+    'error_line' => 'warning: @nodedescription outside of any node
+',
+    'file_name' => '',
+    'line_nr' => 1,
+    'macro' => '',
+    'text' => '@nodedescription outside of any node',
+    'type' => 'warning'
+  },
+  {
+    'error_line' => 'warning: multiple node descriptions
+',
+    'file_name' => '',
+    'line_nr' => 11,
+    'macro' => '',
+    'text' => 'multiple node descriptions',
+    'type' => 'warning'
+  }
+];
+
+
+$result_floats{'nodedescription'} = {};
+
+
+
+$result_converted{'plaintext'}->{'nodedescription'} = 'top
+***
+
+1 Chapter
+*********
+
+of chapter
+';
+
+
+$result_converted{'html_text'}->{'nodedescription'} = '
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+ &nbsp; </p>
+</div>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top"> 
&para;</a></span></h1>
+
+<ul class="mini-toc">
+<li><a href="#chap" accesskey="1">Chapter</a></li>
+</ul>
+<hr>
+<div class="chapter-level-extent" id="chap">
+<div class="nav-panel">
+<p>
+ &nbsp; </p>
+</div>
+<h2 class="chapter" id="Chapter"><span>1 Chapter<a class="copiable-link" 
href="#Chapter"> &para;</a></span></h2>
+
+
+<p>of chapter
+</p></div>
+</div>
+';
+
+
+$result_converted{'latex'}->{'nodedescription'} = '\\documentclass{book}
+\\usepackage{amsfonts}
+\\usepackage{amsmath}
+\\usepackage[gen]{eurosym}
+\\usepackage{textcomp}
+\\usepackage{graphicx}
+\\usepackage{etoolbox}
+\\usepackage{titleps}
+\\usepackage[utf8]{inputenc}
+\\usepackage[T1]{fontenc}
+\\usepackage{float}
+% use hidelinks to remove boxes around links to be similar to Texinfo TeX
+\\usepackage[hidelinks]{hyperref}
+
+\\makeatletter
+\\newcommand{\\Texinfosettitle}{No Title}%
+
+% redefine the \\mainmatter command such that it does not clear page
+% as if in double page
+\\renewcommand\\mainmatter{\\clearpage\\@mainmattertrue\\pagenumbering{arabic}}
+\\newenvironment{Texinfopreformatted}{%
+  
\\par\\GNUTobeylines\\obeyspaces\\frenchspacing\\parskip=\\z@\\parindent=\\z@}{}
+{\\catcode`\\^^M=13 \\gdef\\GNUTobeylines{\\catcode`\\^^M=13 
\\def^^M{\\null\\par}}}
+\\newenvironment{Texinfoindented}{\\begin{list}{}{}\\item\\relax}{\\end{list}}
+
+% used for substitutions in commands
+\\newcommand{\\Texinfoplaceholder}[1]{}
+
+\\newpagestyle{single}{\\sethead[\\chaptername{} \\thechapter{} 
\\chaptertitle{}][][\\thepage]
+                              {\\chaptername{} \\thechapter{} 
\\chaptertitle{}}{}{\\thepage}}
+
+% allow line breaking at underscore
+\\let\\Texinfounderscore\\_
+\\renewcommand{\\_}{\\Texinfounderscore\\discretionary{}{}{}}
+\\renewcommand{\\includegraphics}[1]{\\fbox{FIG \\detokenize{#1}}}
+
+\\makeatother
+% set default for @setchapternewpage
+\\makeatletter
+\\patchcmd{\\chapter}{\\if@openright\\cleardoublepage\\else\\clearpage\\fi}{\\Texinfoplaceholder{setchapternewpage
 placeholder}\\clearpage}{}{}
+\\makeatother
+\\pagestyle{single}%
+
+
+\\label{anchor:Top}%
+\\chapter{{Chapter}}
+\\label{anchor:chap}%
+
+
+  of chapter
+\\end{document}
+';
+
+1;
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 28efdb5e74..01eb087bd4 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -441,7 +441,8 @@ sub new_test($;$$$)
 
 # keys under 'info' are not needed here.
 my @contents_keys = ('contents', 'args', 'parent', 'source_info',
-  'node_content', 'invalid_nesting', 'info', 'text_arg');
+  'node_content', 'invalid_nesting', 'info', 'text_arg',
+  'node_description');
 my @menus_keys = ('menu_next', 'menu_up', 'menu_prev', 'menu_up_hash');
 # 'section_number' is kept in other results as it may be the only clue
 # to know which section element it is.



reply via email to

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