[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Convert/Plaintext.pm t/...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Convert/Plaintext.pm t/... |
Date: |
Thu, 17 Feb 2011 22:20:36 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/02/17 22:20:36
Modified files:
tp : TODO
tp/Texinfo/Convert: Plaintext.pm
tp/t : plaintext_tests.t
Added files:
tp/t/results/plaintext_tests: space_at_menu_end.pl
Log message:
Handle empty line in menu like other empty lines.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.85&r2=1.86
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.87&r2=1.88
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/plaintext_tests.t?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/plaintext_tests/space_at_menu_end.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -b -r1.85 -r1.86
--- TODO 17 Feb 2011 20:07:34 -0000 1.85
+++ TODO 17 Feb 2011 22:20:34 -0000 1.86
@@ -41,6 +41,13 @@
It is unclear whether it is right or wrong, but even less clear why it
happens this way.
+Should
address@hidden Top
address@hidden
+* (out)::
address@hidden menu
+lead to Node: Top, Next: (out), Up: (dir)
+
Force end lines before/after a menu?
With something like
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -b -r1.87 -r1.88
--- Texinfo/Convert/Plaintext.pm 17 Feb 2011 21:36:58 -0000 1.87
+++ Texinfo/Convert/Plaintext.pm 17 Feb 2011 22:20:34 -0000 1.88
@@ -1126,7 +1126,8 @@
#Â First handle empty lines. This has to be done before the handling
#Â of text below to be sure that an empty line is always processed
#Â especially
- if ($root->{'type'} and $root->{'type'} eq 'empty_line') {
+ if ($root->{'type'} and ($root->{'type'} eq 'empty_line'
+ or $root->{'type'} eq 'after_description_line')) {
my $count = $self->{'empty_lines_count'};
$count = '' if (!defined($count));
print STDERR "EMPTY_LINE ($count)\n"
Index: t/plaintext_tests.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/plaintext_tests.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- t/plaintext_tests.t 14 Feb 2011 23:50:11 -0000 1.2
+++ t/plaintext_tests.t 17 Feb 2011 22:20:34 -0000 1.3
@@ -42,6 +42,16 @@
@exdent before samp. @samp{a}. after samp, w @w{in w. after dot} afterw
@end quotation
'],
+['space_at_menu_end',
+'@node Top
+
address@hidden
+* (out)::
+
address@hidden menu
+
+A para.
+'],
['star_at_command_formatting',
'@macro mymacro
Some text @*
Index: t/results/plaintext_tests/space_at_menu_end.pl
===================================================================
RCS file: t/results/plaintext_tests/space_at_menu_end.pl
diff -N t/results/plaintext_tests/space_at_menu_end.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/plaintext_tests/space_at_menu_end.pl 17 Feb 2011 22:20:35
-0000 1.1
@@ -0,0 +1,256 @@
+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{'space_at_menu_end'} = {
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'text_root'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Top'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'menu',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => '* ',
+ 'type' => 'menu_entry_leading_text'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '(out)'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'menu_entry_node'
+ },
+ {
+ 'parent' => {},
+ 'text' => '::',
+ 'type' => 'menu_entry_separator'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'menu_entry_description'
+ }
+ ],
+ 'extra' => {
+ 'menu_entry_node' => {
+ 'manual_content' => [
+ {
+ 'parent' => {},
+ 'text' => 'out'
+ }
+ ]
+ }
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ },
+ 'parent' => {},
+ 'type' => 'menu_entry'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'after_description_line'
+ },
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'menu_comment'
+ }
+ ],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'A para.
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [],
+ 'normalized' => 'Top'
+ }
+ ],
+ 'normalized' => 'Top'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'space_at_menu_end'}{'contents'}[0]{'parent'} =
$result_trees{'space_at_menu_end'};
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0]{'parent'} =
$result_trees{'space_at_menu_end'}{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[0]{'parent'} =
$result_trees{'space_at_menu_end'}{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[0]{'parent'}
=
$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1]{'contents'}[0]{'parent'}
=
$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1]{'parent'}
=
$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[2]{'parent'}
=
$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[3]{'parent'}
=
$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'extra'}{'menu_entry_node'}{'manual_content'}[0]{'parent'}
=
$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'args'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'contents'}[3]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[1]{'parent'} =
$result_trees{'space_at_menu_end'}{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[2]{'parent'} =
$result_trees{'space_at_menu_end'}{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[3]{'parent'} =
$result_trees{'space_at_menu_end'}{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[4]{'contents'}[0]{'parent'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[4];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'contents'}[4]{'parent'} =
$result_trees{'space_at_menu_end'}{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'extra'}{'node_content'}[0]
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'args'}[0]{'contents'}[1];
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}
= $result_trees{'space_at_menu_end'}{'contents'}[1]{'extra'}{'node_content'};
+$result_trees{'space_at_menu_end'}{'contents'}[1]{'parent'} =
$result_trees{'space_at_menu_end'};
+
+$result_texis{'space_at_menu_end'} = '@node Top
+
address@hidden
+* (out)::
+
address@hidden menu
+
+A para.
+';
+
+
+$result_texts{'space_at_menu_end'} = '
+* (out)::
+
+
+A para.
+';
+
+$result_sectioning{'space_at_menu_end'} = {};
+
+$result_nodes{'space_at_menu_end'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'menus' => [
+ {
+ 'cmdname' => 'menu'
+ }
+ ],
+ 'node_up' => {
+ 'extra' => {
+ 'manual_content' => [
+ {
+ 'text' => 'dir'
+ }
+ ]
+ }
+ }
+};
+
+$result_menus{'space_at_menu_end'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+};
+
+$result_errors{'space_at_menu_end'} = [];
+
+
+
+$result_converted{'plaintext'}->{'space_at_menu_end'} = '
+* Menu:
+
+* (out)::
+
+A para.
+';
+
+1;