texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_


From: Patrice Dumas
Subject: branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_protect_colon) (_prepare_anchor, _convert_pod): protect colons in node names and in references.
Date: Sat, 13 Aug 2022 15:19:02 -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 2ae4e046f1 * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm 
(_protect_colon) (_prepare_anchor, _convert_pod): protect colons in node names 
and in references.
2ae4e046f1 is described below

commit 2ae4e046f127b2d7884ef84b726fcec32bf0b5ab
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 13 21:17:13 2022 +0200

    * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_protect_colon)
    (_prepare_anchor, _convert_pod): protect colons in node names
    and in references.
---
 ChangeLog                                    |  6 +++++
 Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm | 15 +++++++++++--
 Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t    | 33 ++++++++++++++++++++++++----
 3 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f053d26aa8..9ef53cadc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,12 @@
        * doc/texinfo.tex (\ifflagclear): New macro, to check if
        a flag has been @set or not.  Use throughout.
 
+2022-08-13  Patrice Dumas  <pertusus@free.fr>
+
+       * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_protect_colon)
+       (_prepare_anchor, _convert_pod): protect colons in node names
+       and in references.
+
 2022-08-13  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Structuring.pm (new_node_menu_entry): do not
diff --git a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm 
b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
index 3d0b417093..ae3b099f70 100644
--- a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
+++ b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
@@ -32,7 +32,8 @@ use Texinfo::Convert::NodeNameNormalization 
qw(normalize_node);
 use Texinfo::Parser qw(parse_texi_line parse_texi_text);
 use Texinfo::Convert::Texinfo;
 use Texinfo::Convert::TextContent;
-use Texinfo::Common qw(protect_comma_in_tree protect_first_parenthesis);
+use Texinfo::Common qw(protect_colon_in_tree protect_comma_in_tree
+                                         protect_first_parenthesis);
 use Texinfo::Transformations qw(protect_hashchar_at_line_beginning
                                           reference_to_arg_in_tree);
 
@@ -327,6 +328,14 @@ sub _protect_comma($)
   return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
 }
 
+sub _protect_colon($)
+{
+  my $texinfo = shift;
+  my $tree = parse_texi_line(undef, $texinfo);
+  $tree = protect_colon_in_tree($tree);
+  return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
+}
+
 sub _protect_hashchar($)
 {
   my $texinfo = shift;
@@ -466,6 +475,7 @@ sub _prepare_anchor($$)
     $node_tree = parse_texi_line(undef, $texinfo_node_name);
   }
   $node_tree = protect_comma_in_tree($node_tree);
+  $node_tree = protect_colon_in_tree($node_tree);
   $self->{'texinfo_nodes'}->{$normalized} = $node_tree;
   my $final_node_name = 
Texinfo::Convert::Texinfo::convert_to_texinfo($node_tree, 1);
   return $final_node_name;
@@ -636,8 +646,9 @@ sub _convert_pod($)
               #print STDERR "L: internal: $texinfo_node/$texinfo_section\n";
             }
             $texinfo_node = _normalize_texinfo_name(
+                    _protect_colon(
                     # FIXME remove end of lines?
-                    _protect_comma(_protect_text($texinfo_node, 0, 1)), 
'anchor');
+                    _protect_comma(_protect_text($texinfo_node, 0, 1))), 
'anchor');
             #print STDERR "L: normalized node: $texinfo_node\n";
 
             # for pod, 'to' is the pod manual name.  Then 'section' is the
diff --git a/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t 
b/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t
index 5c3a82dec1..e640e6b5ed 100644
--- a/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t
+++ b/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t
@@ -6,7 +6,7 @@
 # change 'tests => 1' to 'tests => last_test_to_print';
 
 use Test::More;
-BEGIN { plan tests => 18 };
+BEGIN { plan tests => 19 };
 use Pod::Simple::Texinfo;
 ok(1); # If we made it this far, we're ok.
 
@@ -57,16 +57,18 @@ X<aaa>
 
 TODO: {
 
+# fixed in 3.24 2013-02-14
 local $TODO = 'Pod::Simple not ignoring correctly X<>';
 
 run_test ('=head1 NAME
 X<aaa>
 ',
-'@node NAME aaa NAME
-@section NAME
+'@node NAME
+@chapter NAME
 @cindex aaa
 
-', 'index in head node', 1, 2);
+',
+, 'index in head node', 1);
 
 }
 
@@ -242,6 +244,29 @@ L</(man) t>', '@chapter (man) t
 
 ', 'node beginning with a parenthesis');
 
+run_test('=head1 A::b. c
+
+=over
+
+=item D::E. f
+
+=back
+
+L</A::b. c> L</D::E. f>
+','@chapter A::b. c
+@anchor{A@asis{::}b. c}
+
+@table @asis
+@item D::E. f
+@anchor{D@asis{::}E. f}
+
+@end table
+
+@ref{A@asis{::}b. c,, A::b. c} @ref{D@asis{::}E. f,, D::E. f}
+
+',
+'colon and dot in node name');
+
 run_test('=head1 head
 
 # line 4 "ggggg"



reply via email to

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