texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp Texinfo/Parser.pm Texinfo/Convert/XM...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Parser.pm Texinfo/Convert/XM...
Date: Fri, 02 Sep 2011 07:33:26 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/09/02 07:33:26

Modified files:
        tp/Texinfo     : Parser.pm 
        tp/Texinfo/Convert: XML.pm 
        tp/t           : 02coverage.t 

Log message:
        Keep preamble in XML.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.283&r2=1.284
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/XML.pm?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.56&r2=1.57

Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.283
retrieving revision 1.284
diff -u -b -r1.283 -r1.284
--- Texinfo/Parser.pm   31 Aug 2011 20:42:00 -0000      1.283
+++ Texinfo/Parser.pm   2 Sep 2011 07:33:24 -0000       1.284
@@ -810,9 +810,13 @@
     }
   }
   my $root = { 'contents' => [], 'type' => 'text_root' };
+  if (@first_lines) {
+    push @{$root->{'contents'}}, { 'type' => 'preamble', 'contents' => [] };
   foreach my $line (@first_lines) {
-    push @{$root->{'contents'}}, { 'text' => $line,
-                                   'type' => 'preamble' };
+      push @{$root->{'contents'}->[-1]->{'contents'}}, 
+                                   { 'text' => $line,
+                                     'type' => 'preamble_text' };
+    }
   }
 
   $self = parser() if (!defined($self));

Index: Texinfo/Convert/XML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/XML.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- Texinfo/Convert/XML.pm      1 Sep 2011 22:00:19 -0000       1.7
+++ Texinfo/Convert/XML.pm      2 Sep 2011 07:33:25 -0000       1.8
@@ -25,6 +25,7 @@
 #       menu comment -> menucomment
 #       menu entry description -> menudescription
 #       preformatted -> pre
+#       preamble
 
 
 package Texinfo::Convert::XML;
@@ -78,9 +79,9 @@
 
 my %specific_xml_commands_formatting = (
            '*' => '&linebreak;',
-           ' ' => '<spacecmd type="spc">',
-           "\t" => '<spacecmd type="tab">',
-           "\n" => '<spacecmd type="nl">',
+           ' ' => '<spacecmd type="spc"/>',
+           "\t" => '<spacecmd type="tab"/>',
+           "\n" => '<spacecmd type="nl"/>',
            '-' => '&hyphenbreak;',  # hyphenation hint
            '|' => '',  # used in formatting commands @evenfooting and friends
            '/' => '&slashbreak;',
@@ -209,7 +210,7 @@
 }
 
 my %ignored_types;
-foreach my $type ('empty_line_after_command', 'preamble',
+foreach my $type ('empty_line_after_command',
             'empty_spaces_after_command', 'spaces_at_end',
             'empty_spaces_before_argument', 'empty_spaces_before_paragraph',
             'empty_spaces_after_close_brace', 
@@ -229,6 +230,7 @@
   'menu_comment' => 'menucomment',
   'menu_entry_description' => 'menudescription',
   'menu_entry_name' => 'menutitle',
+  'preamble' => 'preamble',
 );
 
 my %context_block_commands = (

Index: t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- t/02coverage.t      14 Aug 2011 20:23:04 -0000      1.56
+++ t/02coverage.t      2 Sep 2011 07:33:26 -0000       1.57
@@ -691,6 +691,7 @@
 foreach my $test (@test_cases) {
   push @{$test->[2]->{'test_formats'}}, 'plaintext';
   push @{$test->[2]->{'test_formats'}}, 'html_text';
+#  push @{$test->[2]->{'test_formats'}}, 'xml';
 }
 
 our ($arg_test_case, $arg_generate, $arg_debug);



reply via email to

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