texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert):


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): ignore @def* arguments that have not been split off with a role added from the @def line args.
Date: Sat, 03 Dec 2022 11:40:48 -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 c30cae4a38 * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): ignore 
@def* arguments that have not been split off with a role added from the @def 
line args.
c30cae4a38 is described below

commit c30cae4a388b7aacbb12ebe2a0392f6a28bfb68b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Dec 3 17:30:34 2022 +0100

    * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): ignore @def*
    arguments that have not been split off with a role added from the @def
    line args.
---
 ChangeLog                                            |  6 ++++++
 tp/TODO                                              | 14 ++++++++++++++
 tp/Texinfo/Convert/TexinfoMarkup.pm                  | 11 +++++++----
 tp/t/19def.t                                         |  5 +++--
 tp/t/57invalid_nestings.t                            | 14 +++++++-------
 tp/t/results/def/end_of_line_end_file.pl             |  5 +++++
 tp/t/results/def/end_of_line_protect_at_end.pl       |  6 ++++++
 tp/t/results/invalid_nestings/section_on_def_line.pl | 18 ++++++++++++++++++
 8 files changed, 66 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fe89ee200e..e510eacb85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-12-03  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): ignore @def*
+       arguments that have not been split off with a role added from the @def
+       line args.
+
 2022-12-03  Gavin Smith  <gavinsmith0123@gmail.com>
 
        Run gnulib-tool --add-import mkstemp.
diff --git a/tp/TODO b/tp/TODO
index d68ff237f2..e2323765e3 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -10,6 +10,10 @@ This is the todo list for texi2any
 Before next release
 ===================
 
+Test @deffnx interrupted 
+
+Process @def* interrupted.
+
 Bugs
 ====
 
@@ -681,6 +685,16 @@ Misc notes
 export XML_CATALOG_FILES=~/src/texinfo/tp/maintain/catalog.xml
 xmllint --nonet --noout --valid commands.xml
 
+(
+for file in check_back_xml_forth_texi/backforth_xmltexi/*/*.xml; do
+  dir=`dirname "$file" | sed 
's;check_back_xml_forth_texi/backforth_xmltexi/;;'`
+  bfile=`basename "$file" .xml`
+  echo $dir "$bfile"
+  mkdir -p check_back_xml_forth_texi/xmllint/$dir
+  xmllint --nonet --noout --valid $file > 
"check_back_xml_forth_texi/xmllint/$dir/${bfile}_lint.1" 
2>"check_back_xml_forth_texi/xmllint/$dir/${bfile}_lint.2"
+done
+) > check_back_xml_forth_texi/check_xmllint.log 2>&1
+
 tidy -qe *.html
 
 profiling: package on debian:
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index df25c24afe..4d80936097 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -1480,21 +1480,24 @@ sub _convert($$;$)
       $result .= $self->txi_markup_open_element('definitionterm');
       $result .= $self->_index_entry($element);
       push @{$self->{'document_context'}->[-1]->{'monospace'}}, 1;
+      my $def_command = $element->{'extra'}->{'def_command'};
       if ($element->{'args'} and @{$element->{'args'}}
           and $element->{'args'}->[0]->{'contents'}) {
         my $main_command;
         my $alias;
-        if 
($Texinfo::Common::def_aliases{$element->{'extra'}->{'def_command'}}) {
+        if ($Texinfo::Common::def_aliases{$def_command}) {
           $main_command
-            = 
$Texinfo::Common::def_aliases{$element->{'extra'}->{'def_command'}};
+            = $Texinfo::Common::def_aliases{$def_command};
           $alias = 1;
         } else {
-          $main_command = $element->{'extra'}->{'def_command'};
+          $main_command = $def_command;
           $alias = 0;
         }
         foreach my $arg (@{$element->{'args'}->[0]->{'contents'}}) {
+          # should only happen for dubious trees in which the def line
+          # was not split in def roles
+          next if (not $arg->{'extra'} or not $arg->{'extra'}->{'def_role'});
           my $type = $arg->{'extra'}->{'def_role'};
-          next if !$type and $arg->{'type'} eq 'spaces';
           my $content = $self->_convert($arg);
           if ($type eq 'spaces') {
             $content =~ s/\n$//;
diff --git a/tp/t/19def.t b/tp/t/19def.t
index fbf98a0b95..c6427074da 100644
--- a/tp/t/19def.t
+++ b/tp/t/19def.t
@@ -434,10 +434,11 @@ Text in preformatted.
 '],
 ['end_of_line_protect_at_end',
 '
-@deffn category2 deffn_name2 arguments2 @'],
+@deffn category2 deffn_name2 arguments2 @',
+{'test_formats' => ['xml'],},],
 ['end_of_line_end_file',
 '@deffn category deffn_name arguments @
-'],
+', {'test_formats' => ['xml'],},],
 # the command with type is compared with the corresponding command without type
 ['empty_deftype',
 '@deftypefun {} f (const type& x)
diff --git a/tp/t/57invalid_nestings.t b/tp/t/57invalid_nestings.t
index c9e38eb70b..d247043dfb 100644
--- a/tp/t/57invalid_nestings.t
+++ b/tp/t/57invalid_nestings.t
@@ -99,13 +99,6 @@ Somethin
 
 Content
 '],
-['section_on_def_line',
-'@deffn a b @section s
-
-Something
-
-@end deffn
-'],
 ['section_on_defx_line',
 '@deffn h j k l 
 @deffnx a b @section s
@@ -560,6 +553,13 @@ in quotation
 
 @section a section
 '],
+['section_on_def_line',
+'@deffn a b @section s
+
+Something
+
+@end deffn
+'],
 );
 
 foreach my $test (@formatted_cases) {
diff --git a/tp/t/results/def/end_of_line_end_file.pl 
b/tp/t/results/def/end_of_line_end_file.pl
index 1e9aec36f9..a273aa11ad 100644
--- a/tp/t/results/def/end_of_line_end_file.pl
+++ b/tp/t/results/def/end_of_line_end_file.pl
@@ -72,4 +72,9 @@ $result_errors{'end_of_line_end_file'} = [
 $result_floats{'end_of_line_end_file'} = {};
 
 
+
+$result_converted{'xml'}->{'end_of_line_end_file'} = '<deffn spaces=" 
"><definitionterm></definitionterm>
+</deffn>
+';
+
 1;
diff --git a/tp/t/results/def/end_of_line_protect_at_end.pl 
b/tp/t/results/def/end_of_line_protect_at_end.pl
index 8d37e7dde8..aa4c45d559 100644
--- a/tp/t/results/def/end_of_line_protect_at_end.pl
+++ b/tp/t/results/def/end_of_line_protect_at_end.pl
@@ -165,4 +165,10 @@ $result_indices_sort_strings{'end_of_line_protect_at_end'} 
= {
 };
 
 
+
+$result_converted{'xml'}->{'end_of_line_protect_at_end'} = '
+<deffn spaces=" "><definitionterm><indexterm index="fn" 
number="1">deffn_name2</indexterm><defcategory>category2</defcategory> 
<deffunction>deffn_name2</deffunction> <defparam>arguments2</defparam> 
</definitionterm>
+</deffn>
+';
+
 1;
diff --git a/tp/t/results/invalid_nestings/section_on_def_line.pl 
b/tp/t/results/invalid_nestings/section_on_def_line.pl
index 6cbacc82ed..bdb3865f47 100644
--- a/tp/t/results/invalid_nestings/section_on_def_line.pl
+++ b/tp/t/results/invalid_nestings/section_on_def_line.pl
@@ -172,4 +172,22 @@ $result_errors{'section_on_def_line'} = [
 $result_floats{'section_on_def_line'} = {};
 
 
+
+$result_converted{'plaintext'}->{'section_on_def_line'} = '1 s
+===
+
+Something
+
+';
+
+
+$result_converted{'xml'}->{'section_on_def_line'} = '<deffn spaces=" 
"><definitionterm></definitionterm>
+</deffn>
+<section spaces=" "><sectiontitle>s</sectiontitle>
+
+<para>Something
+</para>
+</section>
+';
+
 1;



reply via email to

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