[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Convert/Plaintext.pm t/plain...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Convert/Plaintext.pm t/plain... |
Date: |
Sat, 26 Feb 2011 11:16:56 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/02/26 11:16:56
Modified files:
tp/Texinfo/Convert: Plaintext.pm
tp/t : plaintext_tests.t
Added files:
tp/t/results/plaintext_tests: settitle_and_empty_top.pl
Log message:
Use @settitle contents if @top is empty in Plaintext/Info.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/plaintext_tests.t?cvsroot=texinfo&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/plaintext_tests/settitle_and_empty_top.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- Texinfo/Convert/Plaintext.pm 26 Feb 2011 10:52:59 -0000 1.95
+++ Texinfo/Convert/Plaintext.pm 26 Feb 2011 11:16:56 -0000 1.96
@@ -1708,13 +1708,22 @@
$self->{'setshortcontentsaftertitlepage'} = 0;
$result .= $contents;
}
- # FIXME use settitle
- #if ($root->{'cmdname'} eq 'top' and
address@hidden>{'extra'}->{'misc_content'}}) {
- #}
+ # use settitle for empty @top
+ my $contents;
if (@{$root->{'extra'}->{'misc_content'}}) {
+ $contents = $root->{'extra'}->{'misc_content'};
+ } elsif ($root->{'cmdname'} eq 'top'
+ and $self->{'extra'}->{'settitle'}
+ and $self->{'extra'}->{'settitle'}->{'extra'}
+ and $self->{'extra'}->{'settitle'}->{'extra'}->{'misc_content'}
+ and @{$self->{'extra'}->{'settitle'}->{'extra'}->{'misc_content'}}) {
+ $contents =
$self->{'extra'}->{'settitle'}->{'extra'}->{'misc_content'};
+ }
+
+ if ($contents) {
push @{$self->{'count_context'}}, {'lines' => 0, 'bytes' => 0};
my $heading = $self->convert_line({'type' => 'frenchspacing',
- 'contents' => $root->{'extra'}->{'misc_content'}});
+ 'contents' => $contents});
pop @{$self->{'count_context'}};
#Â FIXME address@hidden and @c?
my $heading_underlined =
Index: t/plaintext_tests.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/plaintext_tests.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- t/plaintext_tests.t 26 Feb 2011 10:52:59 -0000 1.8
+++ t/plaintext_tests.t 26 Feb 2011 11:16:56 -0000 1.9
@@ -3,6 +3,12 @@
require 't/test_utils.pl';
my @test_cases = (
+['settitle_and_empty_top',
+'@settitle Title
+
address@hidden
+
+'],
['anchor_and_empty_lines',
'text 1.
Index: t/results/plaintext_tests/settitle_and_empty_top.pl
===================================================================
RCS file: t/results/plaintext_tests/settitle_and_empty_top.pl
diff -N t/results/plaintext_tests/settitle_and_empty_top.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/plaintext_tests/settitle_and_empty_top.pl 26 Feb 2011 11:16:56
-0000 1.1
@@ -0,0 +1,141 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors);
+
+$result_trees{'settitle_and_empty_top'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Title'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'settitle',
+ 'extra' => {
+ 'misc_content' => [
+ {}
+ ]
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'text_root'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'misc_content' => []
+ },
+ 'level' => 0,
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[2]{'parent'}
=
$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0];
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'extra'}{'misc_content'}[0]
=
$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[1];
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'settitle_and_empty_top'}{'contents'}[0];
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'contents'}[1]{'parent'}
= $result_trees{'settitle_and_empty_top'}{'contents'}[0];
+$result_trees{'settitle_and_empty_top'}{'contents'}[0]{'parent'} =
$result_trees{'settitle_and_empty_top'};
+$result_trees{'settitle_and_empty_top'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'settitle_and_empty_top'}{'contents'}[1]{'args'}[0];
+$result_trees{'settitle_and_empty_top'}{'contents'}[1]{'args'}[0]{'parent'} =
$result_trees{'settitle_and_empty_top'}{'contents'}[1];
+$result_trees{'settitle_and_empty_top'}{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'settitle_and_empty_top'}{'contents'}[1];
+$result_trees{'settitle_and_empty_top'}{'contents'}[1]{'parent'} =
$result_trees{'settitle_and_empty_top'};
+
+$result_texis{'settitle_and_empty_top'} = '@settitle Title
+
address@hidden
+
+';
+
+
+$result_texts{'settitle_and_empty_top'} = '
+
+';
+
+$result_sectioning{'settitle_and_empty_top'} = {
+ 'level' => -1,
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {},
+ 'level' => 0,
+ 'section_up' => {}
+ }
+ ]
+};
+$result_sectioning{'settitle_and_empty_top'}{'section_childs'}[0]{'section_up'}
= $result_sectioning{'settitle_and_empty_top'};
+
+$result_errors{'settitle_and_empty_top'} = [];
+
+
+
+$result_converted{'plaintext'}->{'settitle_and_empty_top'} = '
+Title
+*****
+
+';
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Convert/Plaintext.pm t/plain...,
Patrice Dumas <=