texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/DocBook.pm (_convert): do no


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/DocBook.pm (_convert): do not ignore especially sectionning commands with in_skipped_node_top, let the output be generated and discarded as for the remaining of the output.
Date: Sat, 20 Jan 2024 13:08:07 -0500

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 81960cfbf7 * tp/Texinfo/Convert/DocBook.pm (_convert): do not ignore 
especially sectionning commands with in_skipped_node_top, let the output be 
generated and discarded as for the remaining of the output.
81960cfbf7 is described below

commit 81960cfbf7405bc05f8e8204a611e0e2aadfcba7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jan 20 19:07:52 2024 +0100

    * tp/Texinfo/Convert/DocBook.pm (_convert): do not ignore especially
    sectionning commands with in_skipped_node_top, let the output be
    generated and discarded as for the remaining of the output.
---
 ChangeLog                                    |   6 ++
 tp/Texinfo/Convert/DocBook.pm                | 105 +++++++++++++--------------
 tp/t/30sectioning.t                          |   6 +-
 tp/t/results/sectioning/top_node_part_top.pl |   6 +-
 4 files changed, 60 insertions(+), 63 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 22317d40b4..ad5cfb4000 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-01-20  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/DocBook.pm (_convert): do not ignore especially
+       sectionning commands with in_skipped_node_top, let the output be
+       generated and discarded as for the remaining of the output.
+
 2024-01-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Converter.pm: update POD documentation.
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index a631a1e5e8..338ac982d8 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -928,62 +928,57 @@ sub _convert($$;$)
             }
           }
           foreach my $opened_element (@opened_elements) {
-            if (not (defined($self->{'in_skipped_node_top'})
-                     and $self->{'in_skipped_node_top'} == 1)) {
-              if ($section_element and $opened_element eq $section_element) {
-                $sectioning_commands_done{$section_element} = 1;
-              }
-              my $section_attribute = '';
-              # FIXME it is not clear that a label should be set for
-              # @appendix* or @chapter/@*section as the formatter should be
-              # able to figure it out.  For @unnumbered or if ! NUMBER_SECTIONS
-              # having a label (empty) is important.
-              my $label = '';
-              if (defined($opened_element->{'extra'}->{'section_number'})
-                and ($self->get_conf('NUMBER_SECTIONS')
-                     or !defined($self->get_conf('NUMBER_SECTIONS')))) {
-                # Looking at docbook2html output, Appendix is appended in the
-                # section title, so only the letter is used.
-                $label = $opened_element->{'extra'}->{'section_number'};
-              }
-              my $docbook_sectioning_element
-                 = $self->_docbook_section_element($opened_element);
-              if (! $docbook_special_unnumbered{$docbook_sectioning_element}) {
-                $section_attribute .= " label=\"$label\"";
-              }
-              if ($opened_element->{'extra'}
-                  and $opened_element->{'extra'}->{'associated_node'}
-                  and 
$opened_element->{'extra'}->{'associated_node'}->{'extra'}
-                  and 
defined($opened_element->{'extra'}->{'associated_node'}->{'extra'}->{'normalized'}))
 {
-                $section_attribute
-                 .= " 
id=\"$opened_element->{'extra'}->{'associated_node'}->{'extra'}->{'normalized'}\"";
-              }
-              my $language = '';
-              if (defined($self->get_conf('documentlanguage'))) {
-                $language = $self->get_conf('documentlanguage');
-                if ($self->{'lang_stack'}->[-1] ne $language) {
-                  $section_attribute .= ' lang="'.$language.'"';
-                }
-              }
-              push @{$self->{'lang_stack'}}, $language;
-              $result .= "<$docbook_sectioning_element${section_attribute}>\n";
-              if ($opened_element->{'args'} and 
$opened_element->{'args'}->[0]) {
-                my ($arg, $end_line) = 
$self->_convert_argument_and_end_line($opened_element);
-                $result .= "<title>$arg</title>$end_line";
-                chomp ($result);
-                $result .= "\n";
-              }
-              # if associated with a sectioning element, the part is opened 
before the
-              # sectioning element, such that the part content appears after 
the sectioning
-              # command opening, no need for partintro.
-              if ($docbook_sectioning_element eq 'part'
-                  and not ($opened_element->{'extra'}
-                           and 
$opened_element->{'extra'}->{'part_associated_section'})
-                  and !Texinfo::Common::is_content_empty($opened_element)) {
-                $result .= "<partintro>\n";
+            if ($section_element and $opened_element eq $section_element) {
+              $sectioning_commands_done{$section_element} = 1;
+            }
+            my $section_attribute = '';
+            # FIXME it is not clear that a label should be set for
+            # @appendix* or @chapter/@*section as the formatter should be
+            # able to figure it out.  For @unnumbered or if ! NUMBER_SECTIONS
+            # having a label (empty) is important.
+            my $label = '';
+            if (defined($opened_element->{'extra'}->{'section_number'})
+              and ($self->get_conf('NUMBER_SECTIONS')
+                   or !defined($self->get_conf('NUMBER_SECTIONS')))) {
+              # Looking at docbook2html output, Appendix is appended in the
+              # section title, so only the letter is used.
+              $label = $opened_element->{'extra'}->{'section_number'};
+            }
+            my $docbook_sectioning_element
+               = $self->_docbook_section_element($opened_element);
+            if (! $docbook_special_unnumbered{$docbook_sectioning_element}) {
+              $section_attribute .= " label=\"$label\"";
+            }
+            if ($opened_element->{'extra'}
+                and $opened_element->{'extra'}->{'associated_node'}
+                and $opened_element->{'extra'}->{'associated_node'}->{'extra'}
+                and 
defined($opened_element->{'extra'}->{'associated_node'}->{'extra'}->{'normalized'}))
 {
+              $section_attribute
+               .= " 
id=\"$opened_element->{'extra'}->{'associated_node'}->{'extra'}->{'normalized'}\"";
+            }
+            my $language = '';
+            if (defined($self->get_conf('documentlanguage'))) {
+              $language = $self->get_conf('documentlanguage');
+              if ($self->{'lang_stack'}->[-1] ne $language) {
+                $section_attribute .= ' lang="'.$language.'"';
               }
-            } else {
-              push @{$self->{'lang_stack'}}, $self->{'lang_stack'}->[-1];
+            }
+            push @{$self->{'lang_stack'}}, $language;
+            $result .= "<$docbook_sectioning_element${section_attribute}>\n";
+            if ($opened_element->{'args'} and $opened_element->{'args'}->[0]) {
+              my ($arg, $end_line) = 
$self->_convert_argument_and_end_line($opened_element);
+              $result .= "<title>$arg</title>$end_line";
+              chomp ($result);
+              $result .= "\n";
+            }
+            # if associated with a sectioning element, the part is opened 
before the
+            # sectioning element, such that the part content appears after the 
sectioning
+            # command opening, no need for partintro.
+            if ($docbook_sectioning_element eq 'part'
+                and not ($opened_element->{'extra'}
+                         and 
$opened_element->{'extra'}->{'part_associated_section'})
+                and !Texinfo::Common::is_content_empty($opened_element)) {
+              $result .= "<partintro>\n";
             }
           }
         }
diff --git a/tp/t/30sectioning.t b/tp/t/30sectioning.t
index a553ad07ba..859c447e71 100644
--- a/tp/t/30sectioning.t
+++ b/tp/t/30sectioning.t
@@ -800,9 +800,6 @@ Top node
 
 @part part
 '],
-# FIXME in DocBook the nesting is incorrect, part is opened before chapter
-# and is closed first too.  This is not an important bug, however, as
-# this construct is not normal, and @top has no equivalent in DocBook.
 ['top_node_part_top',
 '@node Top
 
@@ -1268,6 +1265,9 @@ in chap
 
 @chapter chapter
 '],
+# FIXME in DocBook the nesting is incorrect, part is opened before chapter
+# and is closed first too.  This is not an important bug, however, as
+# this construct is not normal, and @top has no equivalent in DocBook.
 ['top_part_chapter',
 '@top top
 
diff --git a/tp/t/results/sectioning/top_node_part_top.pl 
b/tp/t/results/sectioning/top_node_part_top.pl
index 9aab5f6c16..13893683f7 100644
--- a/tp/t/results/sectioning/top_node_part_top.pl
+++ b/tp/t/results/sectioning/top_node_part_top.pl
@@ -374,11 +374,7 @@ $result_converted{'xml'}->{'top_node_part_top'} = '<node 
name="Top" spaces=" "><
 ';
 
 
-$result_converted{'docbook'}->{'top_node_part_top'} = '<part label="">
-<title>part</title>
-<chapter label="" id="Top">
-<title>top</title>
-
+$result_converted{'docbook'}->{'top_node_part_top'} = '
 </part>
 </chapter>
 ';



reply via email to

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