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: Wed, 01 Jun 2011 22:27:57 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/06/01 22:27:57

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

Log message:
        Handle before_item type.

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

Patches:
Index: HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- HTML.pm     1 Jun 2011 21:30:10 -0000       1.73
+++ HTML.pm     1 Jun 2011 22:27:57 -0000       1.74
@@ -2542,7 +2542,9 @@
 
   my $current = $command;
   my $pre_class;
-  if ($self->preformatted_number() == 1) {
+  # !defined preformatted_number may happen if there is something before the
+  # first preformatted.  For example an @exdent.
+  if ($self->preformatted_number() and $self->preformatted_number() == 1) {
     my $prepended = $self->_quotation_arg_to_prepend($command);
     $content = $prepended.$content if (defined($prepended));
   }
@@ -2774,6 +2776,25 @@
 
 $default_types_conversion{'menu_comment'} = \&_convert_menu_comment_type;
 
+sub _convert_before_item_type($$$$)
+{
+  my $self = shift;
+  my $type = shift;
+  my $command = shift;
+  my $content = shift;
+
+  my $top_format = $self->top_format();
+  if ($top_format eq 'itemize' or $top_format eq 'enumerate') {
+    return '<li>'. $content .'</li>';
+  } elsif ($top_format eq 'table' or $top_format eq 'vtable' 
+           or $top_format eq 'ftable') {
+    return '<dd>'. $content .'</dd>'."\n";
+  }
+  # multitable
+  return $content;
+}
+
+$default_types_conversion{'before_item'} = \&_convert_before_item_type;
 
 # FIXME not sure that there is contents.  Not sure that it matters either.
 sub _convert_def_line_type($$$$)



reply via email to

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