[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Convert/Info.pm Texinfo/Conv...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Convert/Info.pm Texinfo/Conv... |
Date: |
Mon, 11 Feb 2013 23:32:29 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 13/02/11 23:32:29
Modified files:
tp/Texinfo/Convert: Info.pm Plaintext.pm
tp/init : tex4ht.pm
tp/t/results/converters_tests: at_commands_in_refs.pl
image_formatting.pl
image_with_spaces.pl
tp/t/results/converters_tests/at_commands_in_refs_latin1/res_info:
at_commands_in_refs_latin1.info
tp/t/results/converters_tests/at_commands_in_refs_utf8/res_info:
at_commands_in_refs_utf8.info
tp/t/results/coverage_braces: space_in_image.pl
tp/t/results/info_tests: image_and_punctuation.pl
image_and_spaces_formatting.pl
image_in_paragraph.pl
multiline_image_and_align.pl
tp/t/results/paragraph: image_in_paragraph.pl
tp/t/results/plaintext_tests: multiline_image_and_align.pl
tp/tests/layout/res_parser/formatting_plaintext: formatting.1
Log message:
Never put [ ] around @image text, and always put [ ] around alt
text.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Info.pm?cvsroot=texinfo&r1=1.94&r2=1.95
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.239&r2=1.240
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/init/tex4ht.pm?cvsroot=texinfo&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/converters_tests/at_commands_in_refs.pl?cvsroot=texinfo&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/converters_tests/image_formatting.pl?cvsroot=texinfo&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/converters_tests/image_with_spaces.pl?cvsroot=texinfo&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/converters_tests/at_commands_in_refs_latin1/res_info/at_commands_in_refs_latin1.info?cvsroot=texinfo&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/converters_tests/at_commands_in_refs_utf8/res_info/at_commands_in_refs_utf8.info?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage_braces/space_in_image.pl?cvsroot=texinfo&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/image_and_punctuation.pl?cvsroot=texinfo&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/image_and_spaces_formatting.pl?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/image_in_paragraph.pl?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/multiline_image_and_align.pl?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/paragraph/image_in_paragraph.pl?cvsroot=texinfo&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/plaintext_tests/multiline_image_and_align.pl?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/layout/res_parser/formatting_plaintext/formatting.1?cvsroot=texinfo&r1=1.7&r2=1.8
Patches:
Index: Texinfo/Convert/Info.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Info.pm,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- Texinfo/Convert/Info.pm 7 Feb 2013 00:02:55 -0000 1.94
+++ Texinfo/Convert/Info.pm 11 Feb 2013 23:32:26 -0000 1.95
@@ -438,34 +438,29 @@
}
}
my ($text, $width) = $self->_image_text($root, $basefile);
- my $text_result;
- if (defined($text)) {
- if (!$self->{'formatters'}->[-1]->{'_top_formatter'}) {
- $text_result = '['.$text.']';
- } else {
- $text_result = $text;
- }
+ my $alt;
+ if (defined($root->{'extra'}->{'brace_command_contents'}->[3])) {
+ $alt = Texinfo::Convert::Text::convert(
+ {'contents' => $root->{'extra'}->{'brace_command_contents'}->[3]},
+ {Texinfo::Common::_convert_text_options($self)});
}
my $result;
- if (defined($image_file)) {
+ if (defined($image_file) or (defined($text) and defined($alt))) {
$image_file =~ s/\\/\\\\/g;
$image_file =~ s/\"/\\\"/g;
$result = "\x{00}\x{08}[image src=\"$image_file\"";
if (defined($root->{'extra'}->{'brace_command_contents'}->[3])) {
- my $alt = Texinfo::Convert::Text::convert(
- {'contents' => $root->{'extra'}->{'brace_command_contents'}->[3]},
- {Texinfo::Common::_convert_text_options($self)});
$alt =~ s/\\/\\\\/g;
$alt =~ s/\"/\\\"/g;
$result .= " alt=\"$alt\"";
}
- if (defined($text_result)) {
- $text_result =~ s/\\/\\\\/g;
- $text_result =~ s/\"/\\\"/g;
- $result .= " text=\"$text_result\"";
+ if (defined($text)) {
+ $text =~ s/\\/\\\\/g;
+ $text =~ s/\"/\\\"/g;
+ $result .= " text=\"$text\"";
}
$result .= "\x{00}\x{08}]";
if ($self->{'formatters'}->[-1]->{'_top_formatter'}) {
@@ -474,8 +469,7 @@
my $image_lines_count = ($result =~ tr/\n/\n/) +1;
$self->_add_image($root, $image_lines_count, $width, 1);
} else {
- $result = $self->_image_formatted_text($root, $basefile, $text,
- $text_result);
+ $result = $self->_image_formatted_text($root, $basefile, $text);
$lines_count = ($result =~ tr/\n/\n/);
$self->_add_image($root, $lines_count+1, $width);
}
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.239
retrieving revision 1.240
diff -u -b -r1.239 -r1.240
--- Texinfo/Convert/Plaintext.pm 7 Feb 2013 00:02:55 -0000 1.239
+++ Texinfo/Convert/Plaintext.pm 11 Feb 2013 23:32:26 -0000 1.240
@@ -1322,26 +1322,20 @@
return undef;
}
-sub _image_formatted_text($$$$$)
+sub _image_formatted_text($$$$)
{
my $self = shift;
my $root = shift;
my $basefile = shift;
my $text = shift;
- my $text_result = shift;
my $result;
if (defined($text)) {
- $result = $text_result;
+ $result = $text;
} elsif (defined($root->{'extra'}->{'brace_command_contents'}->[3])) {
- my $alt = Texinfo::Convert::Text::convert(
+ $result = '[' .Texinfo::Convert::Text::convert(
{'contents' => $root->{'extra'}->{'brace_command_contents'}->[3]},
- {Texinfo::Common::_convert_text_options($self)});
- if (!$self->{'formatters'}->[-1]->{'_top_formatter'}) {
- $result = '['.$alt.']';
- } else {
- $result = $alt;
- }
+ {Texinfo::Common::_convert_text_options($self)}) .']';
} else {
$self->line_warn(sprintf($self->__(
"could not find address@hidden file `%s.txt' nor alternate
text"),
@@ -1361,16 +1355,7 @@
{'contents' => $root->{'extra'}->{'brace_command_contents'}->[0]},
{'code' => 1, Texinfo::Common::_convert_text_options($self)});
my ($text, $width) = $self->_image_text($root, $basefile);
- my $text_result;
- if (defined($text)) {
- if (!$self->{'formatters'}->[-1]->{'_top_formatter'}) {
- $text_result = '['.$text.']';
- } else {
- $text_result = $text;
- }
- }
- my $result = $self->_image_formatted_text($root, $basefile, $text,
- $text_result);
+ my $result = $self->_image_formatted_text($root, $basefile, $text);
my $lines_count = ($result =~ tr/\n/\n/);
if (!defined($width)) {
$width = Texinfo::Convert::Unicode::string_width($result);
Index: init/tex4ht.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/init/tex4ht.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- init/tex4ht.pm 2 Feb 2013 23:18:24 -0000 1.16
+++ init/tex4ht.pm 11 Feb 2013 23:32:27 -0000 1.17
@@ -256,7 +256,7 @@
my $cmd = "$commands{$command}->{'exec'} $commands{$command}->{'basefile'}
$options";
print STDERR "tex4ht command: $cmd\n" if ($self->get_conf('VERBOSE'));
if (system($cmd)) {
- $self->document_warn(sprintf(__(
+ $self->document_warn(sprintf($self->__(
"tex4ht.pm: command failed: %s"), $cmd));
return 1;
}
@@ -264,7 +264,7 @@
# extract the html from the file created by tex4ht
my $html_basefile = $commands{$command}->{'html_file'};
unless (open (TEX4HT_HTMLFILE, $html_basefile)) {
- $self->document_warn(sprintf(__("tex4ht.pm: could not open: %s"),
+ $self->document_warn(sprintf($self->__("tex4ht.pm: could not open: %s"),
$html_basefile, $!));
return 1;
}
@@ -290,7 +290,8 @@
}
}
unless ($end_found) {
- $self->document_warn(sprintf(__("tex4ht.pm: end of address@hidden item
%d not found"),
+ $self->document_warn(sprintf($self->__(
+ "tex4ht.pm: end of address@hidden item %d not
found"),
$command, $count));
}
}
Index: t/results/converters_tests/at_commands_in_refs.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/converters_tests/at_commands_in_refs.pl,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- t/results/converters_tests/at_commands_in_refs.pl 2 Feb 2013 23:18:25
-0000 1.31
+++ t/results/converters_tests/at_commands_in_refs.pl 11 Feb 2013 23:32:27
-0000 1.32
@@ -22179,8 +22179,8 @@
****************************************************
-19 [f--ile1] [Image description""\\.]
-************************************
+19 [f--ile1] Image description""\\.
+**********************************
20 @ {} .
***********
@@ -22216,7 +22216,7 @@
e\'\' e;:: *note e. e( e_ .e e< j ee[:: *note i E=` C\',:: *note `` \'\' ` \'
,, ,:: *note << >> << >> < >:: *note `` \'\' --- -- ` \':: *note AAA (fff)
AAA BBB:: *note CCC (rrr) CCC DDD:: *note the someone <address@hidden>
-<address@hidden>:: *note [f--ile1] [Image description""\\.]:: *note @ {} . ::
*note \'cite asis\' in @w b
+<address@hidden>:: *note [f--ile1] Image description""\\.:: *note @ {} . ::
*note \'cite asis\' in @w b
in r SC *str* t VAR "dfn" i:: *note \'env\' \'code\' \'option\' \'samp\'
\'command\' \'file\' \'C-x <ESC>\':: *note 8.27in:: *note sansserif slanted::
*note \'indicateurl\':: *note <http://somewhere_aaa> text (url) ls::
@@ -23033,7 +23033,7 @@
* AAA (fff) AAA BBB::
* CCC (rrr) CCC DDD::
* the someone <address@hidden> <address@hidden>::
-* [f--ile1] [image src="f--ile.png" alt="alt" text="[Image
description\\"\\"\\\\.]"