[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Convert/Plaintext.pm Te...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Convert/Plaintext.pm Te... |
Date: |
Thu, 02 Dec 2010 09:17:33 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 10/12/02 09:17:33
Modified files:
tp : TODO
tp/Texinfo/Convert: Plaintext.pm Text.pm
Added files:
tp/t : test_sort.t
Log message:
Handle unknown @value and ignored preamble text.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Text.pm?cvsroot=texinfo&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/test_sort.t?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- TODO 1 Dec 2010 22:39:43 -0000 1.58
+++ TODO 2 Dec 2010 09:17:32 -0000 1.59
@@ -30,6 +30,8 @@
test @w.
+test unknown @value expanded.
+
test recursive acronym
@acronym{GNU, @acronym{GNU}'s Not Unix}
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- Texinfo/Convert/Plaintext.pm 1 Dec 2010 23:39:50 -0000 1.20
+++ Texinfo/Convert/Plaintext.pm 2 Dec 2010 09:17:32 -0000 1.21
@@ -178,7 +178,7 @@
);
my %ignored_types;
-foreach my $type ('empty_line_after_command',
+foreach my $type ('empty_line_after_command', 'preamble',
'empty_spaces_after_command', 'spaces_at_end',
'empty_spaces_before_argument', 'empty_spaces_before_paragraph') {
$ignored_types{$type} = 1;
@@ -199,7 +199,7 @@
# math is special
my @asis_commands = ('asis', 'w', 'b', 'ctrl', 'i', 'sc', 't', 'r',
'slanted', 'sansserif', 'var', 'verb', 'clicksequence',
- 'headitemfont');
+ 'headitemfont', 'dmn');
foreach my $asis_command (@asis_commands) {
$style_map{$asis_command} = ['', ''];
@@ -765,6 +765,10 @@
$self->convert_line ($root->{'args'}->[0]));
$self->{'empty_lines_count'} = 0 unless ($result eq '');
return $result;
+ } elsif ($command eq 'value') {
+ my $expansion = $self->gdt('@{No value for `{value}\'@}',
+ {'value' => $root->{'type'}});
+ unshift @{$self->{'current_contents'}->[-1]}, $expansion;
} elsif ($root->{'args'} and $root->{'args'}->[0]
and $root->{'args'}->[0]->{'type'}
and $root->{'args'}->[0]->{'type'} eq 'brace_command_arg') {
Index: Texinfo/Convert/Text.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Text.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- Texinfo/Convert/Text.pm 1 Dec 2010 23:39:50 -0000 1.24
+++ Texinfo/Convert/Text.pm 2 Dec 2010 09:17:32 -0000 1.25
@@ -556,7 +556,7 @@
}
my %ignored_types;
-foreach my $type ('empty_line_after_command',
+foreach my $type ('empty_line_after_command', 'preamble',
'empty_spaces_after_command', 'spaces_at_end',
'empty_spaces_before_argument', 'empty_spaces_before_paragraph') {
$ignored_types{$type} = 1;
@@ -575,8 +575,8 @@
if (!$current->{'args'} or !$current->{'cmdname'}
or !$accent_commands{$current->{'cmdname'}}) {
print STDERR "BUG: Not an accent command in accent\n";
- print STDERR Data::Dumper->Dump([$current]);
print STDERR Texinfo::Convert::Texinfo::convert($current)."\n";
+ print STDERR Data::Dumper->Dump([$current]);
last;
}
push @accent_commands, $current->{'cmdname'};
Index: t/test_sort.t
===================================================================
RCS file: t/test_sort.t
diff -N t/test_sort.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/test_sort.t 2 Dec 2010 09:17:32 -0000 1.1
@@ -0,0 +1,24 @@
+use strict;
+
+use Test::More;
+BEGIN { plan tests => 4 };
+
+use lib '../texi2html/lib/Unicode-EastAsianWidth/lib/';
+use Texinfo::Convert::Text;
+use Texinfo::Parser;
+
+ok(1, "modules loading");
+
+my $tree = Texinfo::Parser::parse_texi_line(undef, '@copyright{}
@quotedblbase{}');
+my $result = Texinfo::Convert::Text::convert($tree, {'sort_string' => 1});
+is ($result, 'C ,,', 'sort no encoding');
+
+$result = Texinfo::Convert::Text::convert($tree, {'sort_string' => 1,
+ 'enable_encoding' => 'utf-8'});
+
+is ($result, "\x{00A9} \x{201E}", 'sort utf-8');
+
+$result = Texinfo::Convert::Text::convert($tree, {'sort_string' => 1,
+ 'enable_encoding' => 'iso-8859-1'});
+
+is ($result, "\x{00A9} ,,", 'sort iso-8859-1');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp TODO Texinfo/Convert/Plaintext.pm Te...,
Patrice Dumas <=