[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Structuring.pm Texinfo/...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Structuring.pm Texinfo/... |
Date: |
Tue, 12 Jul 2011 08:41:24 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/07/12 08:41:23
Modified files:
tp : TODO
tp/Texinfo : Structuring.pm
tp/Texinfo/Convert: HTML.pm
tp/t : html_tests.t
Added files:
tp/t/results/html_tests: commands_in_alt.pl
Log message:
Use correctly context_brace_commands.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.141&r2=1.142
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.101&r2=1.102
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/html_tests.t?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/html_tests/commands_in_alt.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -b -r1.141 -r1.142
--- TODO 10 Jul 2011 15:35:14 -0000 1.141
+++ TODO 12 Jul 2011 08:41:21 -0000 1.142
@@ -1,3 +1,6 @@
+l 3273 in HTML.pm don't be in preformatted for the description.
+but call the function for the other stuff.
+
remove _*directions('This' and replace with new API.
There should be an error message (report by Tom Tromey) in
Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- Texinfo/Structuring.pm 9 Jul 2011 06:35:38 -0000 1.68
+++ Texinfo/Structuring.pm 12 Jul 2011 08:41:22 -0000 1.69
@@ -343,6 +343,9 @@
$menu->{'cmdname'}), $menu->{'line_nr'});
}
}
+ # Remark: since the @menu are only checked if they are in @node,
+ #Â menu entry before the first node may be treated slightly differently.
+ #Â at least, there are no error messages for them
foreach my $menu (@{$node->{'menus'}}) {
my $previous_node;
foreach my $menu_content (@{$menu->{'contents'}}) {
Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- Texinfo/Convert/HTML.pm 10 Jul 2011 15:35:15 -0000 1.101
+++ Texinfo/Convert/HTML.pm 12 Jul 2011 08:41:22 -0000 1.102
@@ -80,7 +80,7 @@
my %style_commands = %Texinfo::Common::style_commands;
my %align_commands = %Texinfo::Common::align_commands;
my %region_commands = %Texinfo::Common::region_commands;
-my %context_brace_command = %Texinfo::Common::context_brace_command;
+my %context_brace_commands = %Texinfo::Common::context_brace_commands;
foreach my $def_command (keys(%def_commands)) {
$formatting_misc_commands{$def_command} = 1 if
($misc_commands{$def_command});
@@ -1410,7 +1410,7 @@
my @extensions = @image_files_extensions;
- if (defined($args->[0]->{'text'})) {
+ if (defined($args->[0]->{'text'}) and $args->[0]->{'text'} ne '') {
my $basefile = $args->[0]->{'text'};
my $extension;
if (defined($args->[4]) and defined($args->[4]->{'text'})) {
@@ -6007,7 +6007,7 @@
if (exists($self->{'commands_conversion'}->{$command_name})) {
my $result;
my $content_formatted;
- if (exists($context_brace_command{$command_name})) {
+ if (exists($context_brace_commands{$command_name})) {
$self->_new_document_context($command_name);
}
push @{$self->{'document_context'}->[-1]->{'commands'}},
@@ -6136,7 +6136,7 @@
pop @{$self->{'document_context'}->[-1]->{'context'}};
}
pop @{$self->{'document_context'}->[-1]->{'commands'}};
- if (exists($context_brace_command{$command_name})) {
+ if (exists($context_brace_commands{$command_name})) {
pop @{$self->{'document_context'}};
}
return $result;
Index: t/html_tests.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/html_tests.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- t/html_tests.t 4 Jun 2011 08:11:37 -0000 1.1
+++ t/html_tests.t 12 Jul 2011 08:41:22 -0000 1.2
@@ -17,6 +17,13 @@
@end multitable
@end example
'],
+['commands_in_alt',
+'@image{f--ile,,,alt @b{in b}}
+
address@hidden
address@hidden,,,alt @b{in b}}
address@hidden example
+']
);
foreach my $test (@test_cases) {
Index: t/results/html_tests/commands_in_alt.pl
===================================================================
RCS file: t/results/html_tests/commands_in_alt.pl
diff -N t/results/html_tests/commands_in_alt.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/html_tests/commands_in_alt.pl 12 Jul 2011 08:41:23 -0000
1.1
@@ -0,0 +1,371 @@
+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_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'commands_in_alt'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'f--ile'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'alt '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'in b'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'b',
+ 'contents' => [],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'image',
+ 'contents' => [],
+ 'extra' => {
+ 'brace_command_contents' => [
+ [
+ {}
+ ],
+ undef,
+ undef,
+ [
+ {},
+ {}
+ ]
+ ]
+ },
+ 'line_nr' => {},
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'example',
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'f--ile'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'alt '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'in b'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'b',
+ 'contents' => [],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'image',
+ 'contents' => [],
+ 'extra' => {
+ 'brace_command_contents' => [
+ [
+ {}
+ ],
+ undef,
+ undef,
+ [
+ {},
+ {}
+ ]
+ ]
+ },
+ 'line_nr' => {},
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'preformatted'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'example'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'command' => {},
+ 'command_argument' => 'example',
+ 'text_arg' => 'example'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'extra' => {
+ 'end_command' => {}
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'commands_in_alt'}{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[1]{'parent'} =
$result_trees{'commands_in_alt'}{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[2]{'parent'} =
$result_trees{'commands_in_alt'}{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[0]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[1]{'args'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[1]{'args'}[0]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[1];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[1]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'parent'} =
$result_trees{'commands_in_alt'}{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'extra'}{'brace_command_contents'}[0][0]
= $result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'extra'}{'brace_command_contents'}[3][0]
= $result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'extra'}{'brace_command_contents'}[3][1]
= $result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[1];
+$result_trees{'commands_in_alt'}{'contents'}[0]{'line_nr'} =
$result_trees{'commands_in_alt'}{'contents'}[0]{'args'}[3]{'contents'}[1]{'line_nr'};
+$result_trees{'commands_in_alt'}{'contents'}[0]{'parent'} =
$result_trees{'commands_in_alt'};
+$result_trees{'commands_in_alt'}{'contents'}[1]{'parent'} =
$result_trees{'commands_in_alt'};
+$result_trees{'commands_in_alt'}{'contents'}[2]{'parent'} =
$result_trees{'commands_in_alt'};
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'commands_in_alt'}{'contents'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[0]{'parent'} =
$result_trees{'commands_in_alt'}{'contents'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[0]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[1]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[2]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[1]{'args'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[1]{'args'}[0]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[1];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[1]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'parent'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'extra'}{'brace_command_contents'}[0][0]
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'extra'}{'brace_command_contents'}[3][0]
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'extra'}{'brace_command_contents'}[3][1]
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[1];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'line_nr'}
=
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'args'}[3]{'contents'}[1]{'line_nr'};
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'contents'}[1]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[1]{'parent'} =
$result_trees{'commands_in_alt'}{'contents'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'args'}[0]{'parent'}
= $result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'extra'}{'command'}
= $result_trees{'commands_in_alt'}{'contents'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2]{'parent'} =
$result_trees{'commands_in_alt'}{'contents'}[3];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'extra'}{'end_command'} =
$result_trees{'commands_in_alt'}{'contents'}[3]{'contents'}[2];
+$result_trees{'commands_in_alt'}{'contents'}[3]{'parent'} =
$result_trees{'commands_in_alt'};
+
+$result_texis{'commands_in_alt'} = '@image{f--ile,,,alt @b{in b}}
+
address@hidden
address@hidden,,,alt @b{in b}}
address@hidden example
+';
+
+
+$result_texts{'commands_in_alt'} = 'f--ile
+
+f--ile
+';
+
+$result_errors{'commands_in_alt'} = [];
+
+
+
+$result_converted{'html'}->{'commands_in_alt'} = '<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- Created by texi2html, http://www.gnu.org/software/texinfo/ -->
+<head>
+<title>Untitled Document</title>
+
+<meta name="description" content="Untitled Document">
+<meta name="keywords" content="Untitled Document">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2html">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+<!--
+a.summary-letter {text-decoration: none}
+blockquote.smallquotation {font-size: smaller}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+div.lisp {margin-left: 3.2em}
+div.smalldisplay {margin-left: 3.2em}
+div.smallexample {margin-left: 3.2em}
+div.smalllisp {margin-left: 3.2em}
+pre.display {font-family: serif}
+pre.format {font-family: serif}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+pre.smalldisplay {font-family: serif; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: serif; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.nocodebreak {white-space:pre}
+span.nolinebreak {white-space:pre}
+span.roman {font-family:serif; font-weight:normal}
+span.sansserif {font-family:sans-serif; font-weight:normal}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF"
vlink="#800080" alink="#FF0000">
+
+<img src="f--ile.png" alt="alt in b">
+
+<div class="example">
+<pre class="example">[ alt <b>in b</b> ]
+</pre></div>
+<p>
+
+
+</p>
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'commands_in_alt'} = [
+ {
+ 'error_line' => 'warning: Must specify a title with a title command or @top
+',
+ 'text' => 'Must specify a title with a title command or @top',
+ 'type' => 'warning'
+ }
+];
+
+
+1;