texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp Texinfo/Convert/Plaintext.pm t/parag...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Convert/Plaintext.pm t/parag...
Date: Sun, 06 Mar 2011 21:31:57 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/03/06 21:31:57

Modified files:
        tp/Texinfo/Convert: Plaintext.pm 
        tp/t           : paragraph.t 
        tp/t/results/plaintext_tests: punctuation_at_end_command.pl 
                                      punctuation_in_command_end_line.pl 

Log message:
        Handle punctuation and style command that keeps punctuation.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.112&r2=1.113
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/paragraph.t?cvsroot=texinfo&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/plaintext_tests/punctuation_at_end_command.pl?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/plaintext_tests/punctuation_in_command_end_line.pl?cvsroot=texinfo&r1=1.1&r2=1.2

Patches:
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- Texinfo/Convert/Plaintext.pm        6 Mar 2011 20:43:32 -0000       1.112
+++ Texinfo/Convert/Plaintext.pm        6 Mar 2011 21:31:56 -0000       1.113
@@ -1359,7 +1359,8 @@
         $text_after = $style_map{$command}->[1];
       }
       $result .= $self->_count_added($formatter->{'container'},
-               $formatter->{'container'}->add_text($text_before));
+               $formatter->{'container'}->add_next($text_before))
+         if ($text_before ne '');
       if ($root->{'args'}) {
         $result .= $self->_convert($root->{'args'}->[0]);
         if ($root->{'cmdname'} eq 'strong' 
@@ -1372,7 +1373,8 @@
         }
       }
       $result .= $self->_count_added($formatter->{'container'},
-               $formatter->{'container'}->add_text($text_after));
+               $formatter->{'container'}->add_next($text_after))
+         if ($text_after ne '');
       if ($command eq 'w') {
         $formatter->{'w'}--;
         $result .= $self->_count_added($formatter->{'container'},

Index: t/paragraph.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/paragraph.t,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- t/paragraph.t       6 Mar 2011 20:43:32 -0000       1.18
+++ t/paragraph.t       6 Mar 2011 21:31:56 -0000       1.19
@@ -9,7 +9,7 @@
 
 #use Test;
 use Test::More;
-BEGIN { plan tests => 115 };
+BEGIN { plan tests => 116 };
 use lib '../texi2html/lib/Unicode-EastAsianWidth/lib/';
 #use lib '../texi2html/lib/libintl-perl/lib/';
 use Texinfo::Convert::Paragraph;
@@ -137,7 +137,17 @@
 $result .= $para->add_next('_');
 $result .= $para->add_text(' after');
 $result .= $para->end();
-is ($result, "aa.)_  after\n", 'add char after end sentence');
+is ($result, "aa.)_  after\n", 'add char after end sentence parentheses');
+
+$para = Texinfo::Convert::Paragraph->new();
+$result = '';
+$result .= $para->add_text('b ');
+$result .= $para->add_next('_');
+$result .= $para->add_text('.');
+$result .= $para->add_next('_');
+$result .= $para->add_text(' after');
+$result .= $para->end();
+is ($result, "b _._  after\n", 'add char after end sentence');
 
 $para = Texinfo::Convert::Paragraph->new();
 $result = '';

Index: t/results/plaintext_tests/punctuation_at_end_command.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/plaintext_tests/punctuation_at_end_command.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2

Index: t/results/plaintext_tests/punctuation_in_command_end_line.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/plaintext_tests/punctuation_in_command_end_line.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2



reply via email to

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