texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp/Texinfo/Convert HTML.pm


From: Patrice Dumas
Subject: texinfo/tp/Texinfo/Convert HTML.pm
Date: Tue, 31 May 2011 23:24:39 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/05/31 23:24:38

Modified files:
        tp/Texinfo/Convert: HTML.pm 

Log message:
        Handle correctly section names.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.70&r2=1.71

Patches:
Index: HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- HTML.pm     31 May 2011 20:36:02 -0000      1.70
+++ HTML.pm     31 May 2011 23:24:37 -0000      1.71
@@ -415,10 +415,24 @@
           cluck "No misc_content: "
             .Texinfo::Parser::_print_current($command);
         }
+        if (defined($command->{'number'})
+            and ($self->get_conf('NUMBER_SECTIONS')
+                 or !defined($self->get_conf('NUMBER_SECTIONS')))) {
+          if ($command->{'cmdname'} eq 'appendix' and $command->{'level'} == 
1) {
+            $tree = $self->gdt('Appendix {number} {section_title}',
+                             {'number' => {'text' => $command->{'number'}},
+                              'section_title'
+                                => {'contents' => 
$command->{'extra'}->{'misc_content'}}});
+          } else {
+            $tree = $self->gdt('{number} {section_title}',
+                             {'number' => {'text' => $command->{'number'}},
+                              'section_title'
+                                => {'contents' => 
$command->{'extra'}->{'misc_content'}}});
+          }
+        } else {
         $tree = {'contents' => address@hidden>{'extra'}->{'misc_content'}}]};
-        if ($command->{'number'}) {
-          unshift @{$tree->{'contents'}}, {'text' => "$command->{'number'} "};
         }
+
         $target->{'tree_nonumber'} 
           = {'contents' => $command->{'extra'}->{'misc_content'}};
       }
@@ -2014,13 +2028,12 @@
 $default_commands_conversion{'ftable'} = \&_convert_xtable_command;
 $default_commands_conversion{'vtable'} = \&_convert_xtable_command;
 
-sub _convert_item_command($$$$;$)
+sub _convert_item_command($$$$)
 {
   my $self = shift;
   my $cmdname = shift;
   my $command = shift;
   my $contents = shift;
-  my $last_arg = shift;
 
   if ($command->{'parent'} 
       and $command->{'parent'}->{'cmdname'} eq 'itemize') {
@@ -2283,8 +2296,8 @@
   my @non_alpha = ();
   my @alpha = ();
   # collect the links
-  foreach my $letter_entry 
(@{$self->{'index_entries_by_letter'}->{$index_name}}) {
     my $symbol_idx = 0;
+  foreach my $letter_entry 
(@{$self->{'index_entries_by_letter'}->{$index_name}}) {
     my $letter = $letter_entry->{'letter'};
     # FIXME id or target?
     my $index_element_id = 
$self->_element_direction($self->{'current_element'},
@@ -5102,11 +5115,11 @@
       if ($brace_commands{$command_name} 
           or ($misc_commands{$command_name} 
               and $misc_commands{$command_name} eq 'line')
-          or ($command_name eq 'item' or $command_name eq 'itemx'
-               and $root->{'parent'}->{'cmdname'}
+          or (($command_name eq 'item' or $command_name eq 'itemx')
+               and ($root->{'parent'}->{'cmdname'}
                and ($root->{'parent'}->{'cmdname'} eq 'table'
                     or $root->{'parent'}->{'cmdname'} eq 'ftable'
-                    or $root->{'parent'}->{'cmdname'} eq 'vtable'))
+                         or $root->{'parent'}->{'cmdname'} eq 'vtable')))
           or ($command_name eq 'quotation' 
               or $command_name eq 'smallquotation')
               or ($command_name eq 'float')) {



reply via email to

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