[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp/Texinfo/Convert HTML.pm
From: |
Patrice Dumas |
Subject: |
texinfo/tp/Texinfo/Convert HTML.pm |
Date: |
Sat, 30 Apr 2011 18:12:26 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/04/30 18:12:26
Modified files:
tp/Texinfo/Convert: HTML.pm
Log message:
Fix reference to node in menu entry.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.42&r2=1.43
Patches:
Index: HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- HTML.pm 30 Apr 2011 17:33:09 -0000 1.42
+++ HTML.pm 30 Apr 2011 18:12:26 -0000 1.43
@@ -328,6 +328,12 @@
return undef;
}
+sub label_command($$)
+{
+ my $self = shift;
+ my $label = shift;
+ return $self->{'labels'}->{$label};
+}
# see http://www.w3.org/TR/REC-html40/types.html#type-links
# see http://www.w3.org/TR/REC-html40/types.html#type-links
@@ -1787,13 +1793,21 @@
my $command = shift;
my $href;
- my $node = $command->{'extra'}->{'menu_entry_node'};
- if ($node->{'manual_content'}) {
- $href = $self->_external_node_href($node,
+ my $node;
+ my $section;
+ my $node_entry = $command->{'extra'}->{'menu_entry_node'};
+ if ($node_entry->{'manual_content'}) {
+ $href = $self->_external_node_href($node_entry,
$self->{'current_filename'});
} else {
- $href = $self->_internal_node_element_href($node->{'normalized'},
- $self->{'current_filename'});
+ $node = $self->label_command($node_entry->{'normalized'});
+ if ($node->{'extra'}->{'associated_section'}
+ and !$self->get_conf('NODE_NAME_IN_MENU')) {
+ $section = $node->{'extra'}->{'associated_section'};
+ $href = $self->command_href($section, $self->{'current_filename'});
+ } else {
+ $href = $self->command_href($node, $self->{'current_filename'});
+ }
}
$html_menu_entry_index++;
@@ -1829,13 +1843,10 @@
my $name;
my $name_no_number;
- if (!$self->get_conf('NODE_NAME_IN_MENU') and !$node->{'manual_content'}) {
- my $section = $self->_internal_node_section($node->{'normalized'});
- if (defined($section)) {
+ if ($section) {
$name = $self->command_text($section, 'text');
$name_no_number = $self->convert_tree
({'contents' => $section->{'extra'}->{'misc_content'}});
- }
if ($href ne '') {
$name = "<a href=\"$href\"$accesskey>".$name."</a>";
}
@@ -3279,27 +3290,6 @@
}
}
-# FIXME or use $node->{'extra'}->{'associated_section'}? It is likely that
-# what is below is before, for example for texinfo like
-# @node node1
-# @node node2
-# @chapter chapter
-sub _internal_node_section($$$)
-{
- my $self = shift;
- my $normalized_node_name = shift;
- my $filename = shift;
-
- my $command = $self->{'labels'}->{$normalized_node_name};
- if ($command) {
- my $element = $command->{'parent'};
- if ($element and $element->{'extra'}->{'section'}) {
- return $element->{'extra'}->{'section'};
- }
- }
- return undef;
-}
-
sub _internal_element_href($$$)
{
my $self = shift;
- texinfo/tp/Texinfo/Convert HTML.pm, (continued)
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/14
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/17
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/17
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/18
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/24
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/25
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/29
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/30
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/30
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/30
- texinfo/tp/Texinfo/Convert HTML.pm,
Patrice Dumas <=
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/30
- texinfo/tp/Texinfo/Convert HTML.pm, Patrice Dumas, 2011/04/30