texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * util/txixml2texi.pl: avoid double comment for l


From: Patrice Dumas
Subject: branch master updated: * util/txixml2texi.pl: avoid double comment for line specific command.
Date: Tue, 29 Nov 2022 16:59:04 -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 188e248a6b * util/txixml2texi.pl: avoid double comment for line 
specific command.
188e248a6b is described below

commit 188e248a6b4ddba34069a87fdfe72ce29944c337
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Nov 29 22:58:42 2022 +0100

    * util/txixml2texi.pl: avoid double comment for line specific command.
---
 ChangeLog           |  4 ++++
 util/txixml2texi.pl | 23 +++++++++++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f0528f60f9..3a6f9dcbbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-11-29  Patrice Dumas  <pertusus@free.fr>
+
+       * util/txixml2texi.pl: avoid double comment for line specific command.
+
 2022-11-28  Patrice Dumas  <pertusus@free.fr>
 
        Protect vertical tab in XML
diff --git a/util/txixml2texi.pl b/util/txixml2texi.pl
index 9510bd19b7..b6f11c7763 100755
--- a/util/txixml2texi.pl
+++ b/util/txixml2texi.pl
@@ -364,17 +364,28 @@ while ($reader->read) {
       if ($reader->hasAttributes() and defined($reader->getAttribute('line'))) 
{
         my $line = $reader->getAttribute('line');
         $line =~ s/\\\\/\x{1F}/g;
+        # convert back formfeed
         $line =~ s/\\f/\f/g;
         $line =~ s/\x{1F}/\\/g;
+        # FIXME needed?
+        #$line =~ s/\\v/\x{000B}/g;
         print $line;
       }
-      if ($name eq 'set' or $name eq 'clickstyle' or $name eq 
'columnfractions') {
+      my $specific_line = (defined($Texinfo::Commands::line_commands{$name})
+                and $Texinfo::Commands::line_commands{$name} eq 'specific');
+      if ($name eq 'set' or $name eq 'clickstyle' or $name eq 'columnfractions'
+          or $specific_line) {
         skip_until_end($reader, $name);
-        if ($name eq 'columnfractions') {
-          # A comment should already appear in the line attribute, so we skip
-          # a redundant XML comment following the columnfractions closing
-          # element.
-          # start at 2 as there is a -1 right after at the end of
+        if ($name eq 'columnfractions' or $specific_line) {
+          # specific line commands have a line argument obtained by converting
+          # their line to Texinfo, which would include a comment on the line,
+          # and could also have a comment associated to the command appearing
+          # after the command as an XML comment.  Similar for columnfraction.
+          #
+          # We skip the possibly existing redundant XML comment following the
+          # closing element.
+          #
+          # start at 2 as there is a -1 right down at the end of
           # the loop, and another -1 for the next element (possibly
           # an ignored comment).
           $skip_comment = 2;



reply via email to

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