[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Convert/HTML.pm t/27float.t
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Convert/HTML.pm t/27float.t |
Date: |
Sun, 10 Jul 2011 08:18:30 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/07/10 08:18:30
Modified files:
tp/Texinfo/Convert: HTML.pm
tp/t : 27float.t
Log message:
Handle correctly things in @*caption that lead to labels.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/27float.t?cvsroot=texinfo&r1=1.12&r2=1.13
Patches:
Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- Texinfo/Convert/HTML.pm 3 Jul 2011 23:15:45 -0000 1.99
+++ Texinfo/Convert/HTML.pm 10 Jul 2011 08:18:30 -0000 1.100
@@ -1305,7 +1305,7 @@
my $args = shift;
my $id = $self->command_id ($command);
- if (defined($id) and $id ne '') {
+ if (defined($id) and $id ne '' and address@hidden>{'multiple_pass'}}) {
return "<a name=\"$id\"></a>";
}
return '';
@@ -1317,6 +1317,8 @@
my $foot_lines;
my $NO_NUMBER_FOOTNOTE_SYMBOL = '*';
+# to avoid duplicate names, use a prefix that cannot happen in anchors
+my $target_prefix = "t_h";
sub _convert_footnote_command($$$$)
{
my $self = shift;
@@ -1359,6 +1361,11 @@
chomp ($footnote_text);
$footnote_text .= "\n";
+ if (@{$self->{'multiple_pass'}}) {
+ $footid =
$target_prefix.$self->{'multiple_pass'}->[-1].'_'.$footid.'_'.$foot_num;
+ $docid =
$target_prefix.$self->{'multiple_pass'}->[-1].'_'.$docid.'_'.$foot_num;
+ }
+
$foot_lines .= '<h3>' .
"<a name=\"$footid\"
href=\"$document_filename#$docid\">($number_in_doc)</a></h3>\n"
. $footnote_text;
@@ -2250,7 +2257,9 @@
my $caption_text;
if ($caption) {
$self->{'ignore_notice'}++;
+ push @{$self->{'multiple_pass'}}, 'listoffloats';
$caption_text = $self->convert_tree($caption->{'args'}->[0]);
+ pop @{$self->{'multiple_pass'}};
$self->{'ignore_notice'}--;
} else {
$caption_text = '';
@@ -2473,8 +2482,11 @@
$prepend = '';
} else {
$self->{'ignore_notice'}++;
+ # This should not be needed, only in case of invalid constructs
+ push @{$self->{'multiple_pass'}}, 'item_prepended';
$prepend = $self->convert_tree(
{'contents' =>
$itemize->{'extra'}->{'block_command_line_contents'}->[0]});
+ pop @{$self->{'multiple_pass'}};
$self->{'ignore_notice'}--;
}
if ($contents =~ /\S/) {
@@ -2756,7 +2768,7 @@
my $args = shift;
my $index_id = $self->command_id ($command);
- if (defined($index_id) and $index_id ne '') {
+ if (defined($index_id) and $index_id ne '' and
address@hidden>{'multiple_pass'}}) {
return "<a name=\"$index_id\"></a>\n";
}
return '';
@@ -3429,7 +3441,7 @@
my $index_label = '';
my $index_id = $self->command_id ($command);
- if (defined($index_id) and $index_id ne '') {
+ if (defined($index_id) and $index_id ne '' and
address@hidden>{'multiple_pass'}}) {
$index_label = "<a name=\"$index_id\"></a>";
}
if (!$self->get_conf('DEF_TABLE')) {
@@ -3827,6 +3839,7 @@
}
$self->{'document_context'} = [],
+ $self->{'multiple_pass'} = [],
$self->_new_document_context('_toplevel_context');
$self->_translate_names();
Index: t/27float.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/27float.t,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- t/27float.t 16 Mar 2011 01:16:43 -0000 1.12
+++ t/27float.t 10 Jul 2011 08:18:30 -0000 1.13
@@ -39,7 +39,7 @@
@listoffloats address@hidden'ee
'],
-['footnote_in_caption',
+['footnote_in_caption', # FIXME HTML
'@node Top
@listoffloats fl
@@ -49,7 +49,7 @@
@caption{in address@hidden footnote}}
@end float
'],
-['anchor_in_caption',
+['anchor_in_caption', # FIXME HTML
'@node Top
@listoffloats fl
@@ -59,7 +59,7 @@
@caption{in address@hidden anchor}}
@end float
'],
-['cindex_in_caption',
+['cindex_in_caption', # FIXME HTML
'@node Top
@listoffloats fl
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Convert/HTML.pm t/27float.t,
Patrice Dumas <=