texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_fil


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files) (_external_node_href), tp/Texinfo/XS/convert/convert_html.c (external_node_href): use an empty string for an htmlxref manual entry without URL prefix instead of undef.
Date: Sat, 24 Aug 2024 11:30:08 -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 94b1ec829d  * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files)  
(_external_node_href), tp/Texinfo/XS/convert/convert_html.c  
(external_node_href): use an empty string for an htmlxref manual  entry without 
URL prefix instead of undef.
94b1ec829d is described below

commit 94b1ec829dfff4e38c3d3ff0883964091d48c338
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 24 17:29:54 2024 +0200

     * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files)
     (_external_node_href), tp/Texinfo/XS/convert/convert_html.c
     (external_node_href): use an empty string for an htmlxref manual
     entry without URL prefix instead of undef.
---
 ChangeLog                                  | 7 +++++++
 tp/Texinfo/Convert/HTML.pm                 | 7 +++++--
 tp/Texinfo/XS/convert/convert_html.c       | 3 ++-
 tp/Texinfo/XS/convert/get_html_perl_info.c | 3 ---
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9a13432f37..eca94e8a52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-08-24  Patrice Dumas  <pertusus@free.fr>
+
+        * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files)
+        (_external_node_href), tp/Texinfo/XS/convert/convert_html.c
+        (external_node_href): use an empty string for an htmlxref manual
+        entry without URL prefix instead of undef.
+
 2024-08-24  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): no warning for
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 3a99bd5530..1806f7b772 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -8670,13 +8670,15 @@ sub _parse_htmlxref_files($$)
       #           {'file_name' => $fname, 'line_nr' => $line_nr});
       #}
       next if ($htmlxref->{$manual}
-               and exists($htmlxref->{$manual}->{$split_or_mono}));
+               and defined($htmlxref->{$manual}->{$split_or_mono}));
 
       if (defined($href)) { # substitute 'variables'
         my $re = join '|', map { quotemeta $_ } keys %variables;
         $href =~ s/\$\{($re)\}/defined $variables{$1} ? $variables{$1}
                                                       : "\${$1}"/ge;
         $href =~ s/\/*$// if ($split_or_mono ne 'mono');
+      } else {
+        $href = '';
       }
       $htmlxref->{$manual} = {} if (!$htmlxref->{$manual});
       $htmlxref->{$manual}->{$split_or_mono} = $href;
@@ -10771,7 +10773,8 @@ sub _external_node_href($$$)
       my $document_split = $self->get_conf('SPLIT');
       $document_split = 'mono' if (!$document_split);
       foreach my $split_ordered (@{$htmlxref_entries{$document_split}}) {
-        if (defined($htmlxref_info->{$split_ordered})) {
+        if (defined($htmlxref_info->{$split_ordered})
+            and $htmlxref_info->{$split_ordered} ne '') {
           $split_found = $split_ordered;
           $htmlxref_href
             = $self->url_protect_url_text($htmlxref_info->{$split_ordered});
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 890a985571..37394c1a88 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -3152,7 +3152,8 @@ external_node_href (CONVERTER *self, const ELEMENT 
*external_node,
             {
               const enum htmlxref_split_type split_ordered
                 = ordered_split_types[i];
-              if (htmlxref_manual->urlprefix[split_ordered])
+              if (htmlxref_manual->urlprefix[split_ordered]
+                  && strlen (htmlxref_manual->urlprefix[split_ordered]))
                 {
                   split_found = split_ordered;
                   htmlxref_href = url_protect_url_text (self,
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c 
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index 0b9ed96b5e..e75b367465 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -213,9 +213,6 @@ html_converter_initialize_sv (SV *converter_sv,
                   const char *split_type_name = htmlxref_split_type_names[j];
                   SV **urlprefix_sv = hv_fetch (split_type_hv, split_type_name,
                                                 strlen (split_type_name), 0);
-                  /* can be undef if there is an entry in the htmlxref.cnf file
-                     without the urlprefix.  We ignore completely, in perl
-                     it is ignored later on when checking an external href */
                   if (urlprefix_sv && SvOK (*urlprefix_sv))
                     {
                       const char *urlprefix = SvPVutf8_nolen (*urlprefix_sv);



reply via email to

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