texi2html-cvs
[Top][All Lists]
Advanced

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

[Texi2html-cvs] texi2html ChangeLog T2h_i18n.pm texi2html.init ...


From: Patrice Dumas
Subject: [Texi2html-cvs] texi2html ChangeLog T2h_i18n.pm texi2html.init ...
Date: Tue, 03 Feb 2009 12:32:40 +0000

CVSROOT:        /cvsroot/texi2html
Module name:    texi2html
Changes by:     Patrice Dumas <pertusus>        09/02/03 12:32:40

Modified files:
        .              : ChangeLog T2h_i18n.pm texi2html.init 
                         texi2html.pl 
        examples       : info.init 
        test/coverage/res/comments: comments.html 
        test/encodings : Makefile.am tests.txt 
        test/formatting: Makefile.am tests.txt 
        test/formatting/res/comments_redefine_need: comments.html 
Added files:
        test/encodings : japanese.texi 
        test/formatting: at_command_glued.texi test_sp.texi 

Log message:
                * texi2html.pl, texi2html.init: @sp stops paragraph and ignores 
up 
                to the end of line.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texi2html/ChangeLog?cvsroot=texi2html&r1=1.364&r2=1.365
http://cvs.savannah.gnu.org/viewcvs/texi2html/T2h_i18n.pm?cvsroot=texi2html&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/texi2html/texi2html.init?cvsroot=texi2html&r1=1.179&r2=1.180
http://cvs.savannah.gnu.org/viewcvs/texi2html/texi2html.pl?cvsroot=texi2html&r1=1.262&r2=1.263
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/info.init?cvsroot=texi2html&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/coverage/res/comments/comments.html?cvsroot=texi2html&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/encodings/Makefile.am?cvsroot=texi2html&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/encodings/tests.txt?cvsroot=texi2html&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/encodings/japanese.texi?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/formatting/Makefile.am?cvsroot=texi2html&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/formatting/tests.txt?cvsroot=texi2html&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/formatting/at_command_glued.texi?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/formatting/test_sp.texi?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/formatting/res/comments_redefine_need/comments.html?cvsroot=texi2html&r1=1.7&r2=1.8

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/texi2html/texi2html/ChangeLog,v
retrieving revision 1.364
retrieving revision 1.365
diff -u -b -r1.364 -r1.365
--- ChangeLog   18 Jan 2009 00:59:29 -0000      1.364
+++ ChangeLog   3 Feb 2009 12:32:38 -0000       1.365
@@ -1,3 +1,8 @@
+2009-02-03  Patrice Dumas  <address@hidden>
+
+       * texi2html.pl, texi2html.init: @sp stops paragraph and ignores up 
+       to the end of line.
+
 2009-01-17  Patrice Dumas  <address@hidden>
 
        * texi2html.pl, texi2html.init: ignore more text and remove more

Index: T2h_i18n.pm
===================================================================
RCS file: /cvsroot/texi2html/texi2html/T2h_i18n.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- T2h_i18n.pm 27 Dec 2008 20:53:24 -0000      1.25
+++ T2h_i18n.pm 3 Feb 2009 12:32:38 -0000       1.26
@@ -321,6 +321,7 @@
         $state = 
main::duplicate_formatting_state($Texi2HTML::THISDOC{'state'});
     }
 
+    my $translated_string;
     my $T2H_LANGUAGES = $Texi2HTML::Config::LANGUAGES;
     if (! exists($T2H_LANGUAGES->{'en'}))
     {
@@ -343,34 +344,38 @@
         if (defined ($T2H_LANGUAGES->{$language}->{$string}) and
            ($T2H_LANGUAGES->{$language}->{$string} ne ''))
         {
-            $string = $T2H_LANGUAGES->{$language}->{$string};
+            $translated_string = $T2H_LANGUAGES->{$language}->{$string};
         }
         elsif (defined ($T2H_LANGUAGES->{'en'}->{$string}) and
             ($T2H_LANGUAGES->{'en'}->{$string} ne ''))
         {
-            $string = $T2H_LANGUAGES->{'en'}->{$string};
+            $translated_string = $T2H_LANGUAGES->{'en'}->{$string};
+        }
+        else
+        {
+            $translated_string = $string;
         }
     }
-    return main::substitute_line($string, $state) unless (defined($arguments) 
or !keys(%$arguments));
+    return main::substitute_line($translated_string, $state) unless 
(defined($arguments) or !keys(%$arguments));
     # if there are arguments, we must protect the %{arg} constructs before
     # doing substitute_line. So there is a first pass here to change %{arg} 
     # to address@hidden@}
     my $result = '';
     if (!$state->{'keep_texi'})
     {
-        while ($string)
+        while ($translated_string)
         {
-            if ($string =~ s/^([^%]*)%//)
+            if ($translated_string =~ s/^([^%]*)%//)
             {
                 $result .= $1 if (defined($1));
                 $result .= '%';
-                if ($string =~ s/^%//)
+                if ($translated_string =~ s/^%//)
                 {
                      $result .= '%';
                 }
-                elsif ($string =~ /^\{(\w+)\}/ and exists($arguments->{$1}))
+                elsif ($translated_string =~ /^\{(\w+)\}/ and 
exists($arguments->{$1}))
                 {
-                     $string =~ s/^\{(\w+)\}//;
+                     $translated_string =~ s/^\{(\w+)\}//;
                      $result .= "address@hidden@\}";
                 }
                 else
@@ -381,28 +386,28 @@
             }
             else 
             {   
-                $result .= $string;
+                $result .= $translated_string;
                 last;
             }
         }
         # the arguments are not already there. But the @-commands in the 
         # strings are substituted.
-        $string = main::substitute_line($result, $state);
+        $translated_string = main::substitute_line($result, $state);
     }
     # now we substitute the arguments 
     $result = '';
-    while ($string)
+    while ($translated_string)
     {
-        if ($string =~ s/^([^%]*)%//)
+        if ($translated_string =~ s/^([^%]*)%//)
         {
             $result .= $1 if (defined($1));
-            if ($string =~ s/^%//)
+            if ($translated_string =~ s/^%//)
             {
                  $result .= '%';
             }
-            elsif ($string =~ /^\{(\w+)\}/ and exists($arguments->{$1}))
+            elsif ($translated_string =~ /^\{(\w+)\}/ and 
exists($arguments->{$1}))
             {
-                 $string =~ s/^\{(\w+)\}//;
+                 $translated_string =~ s/^\{(\w+)\}//;
                  $result .= $arguments->{$1};
             }
             else
@@ -413,7 +418,7 @@
         }
         else 
         {   
-            $result .= $string;
+            $result .= $translated_string;
             last;
         }
     }

Index: texi2html.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/texi2html.init,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -b -r1.179 -r1.180
--- texi2html.init      24 Jan 2009 00:35:08 -0000      1.179
+++ texi2html.init      3 Feb 2009 12:32:38 -0000       1.180
@@ -12,7 +12,7 @@
 # Afterwards, load the file with command-line 
 # option -init-file <your_init_file>
 #
-# $Id: texi2html.init,v 1.179 2009/01/24 00:35:08 pertusus Exp $
+# $Id: texi2html.init,v 1.180 2009/02/03 12:32:38 pertusus Exp $
 
 ######################################################################
 # The following variables can also be set by command-line options
@@ -3031,7 +3031,8 @@
 
 %stop_paragraph_command = (
  'titlefont' => 1,
- 'insertcopying' => 1
+ 'insertcopying' => 1,
+ 'sp' => 1
 );
 
 # on bug-texinfo verified that code_style shouldn't be used for anything
@@ -4202,7 +4203,7 @@
         'oddheadingmarks' => {'skip' => 'whitespace', 'arg' => 1},
         'evenfootingmarks' => {'skip' => 'whitespace', 'arg' => 1},
         'oddfootingmarks' => {'skip' => 'whitespace', 'arg' => 1},
-        'sp' => {'skip' => 'whitespace', 'arg' => 1}, # no arg 
+        'sp' => {'skip' => 'line', 'arg' => 1}, # no arg 
                                     # at the end of line or a numerical arg
         # formatting
         'page' => {}, # no arg (pagebreak)

Index: texi2html.pl
===================================================================
RCS file: /cvsroot/texi2html/texi2html/texi2html.pl,v
retrieving revision 1.262
retrieving revision 1.263
diff -u -b -r1.262 -r1.263
--- texi2html.pl        24 Jan 2009 00:35:09 -0000      1.262
+++ texi2html.pl        3 Feb 2009 12:32:38 -0000       1.263
@@ -74,7 +74,7 @@
 }
 
 # CVS version:
-# $Id: texi2html.pl,v 1.262 2009/01/24 00:35:09 pertusus Exp $
+# $Id: texi2html.pl,v 1.263 2009/02/03 12:32:38 pertusus Exp $
 
 # Homepage:
 my $T2H_HOMEPAGE = "http://www.nongnu.org/texi2html/";;
@@ -7802,7 +7802,9 @@
        else
         {
             binmode(FILE, ':bytes');
+            #binmode(FILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
         }
+        # FIXME is it useful when in utf8?
         binmode(FILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
     }
     return *FILE;
@@ -11736,6 +11738,7 @@
         while (1)
         {
             my $next_tag = next_tag($cline);
+            close_paragraph($text, $stack, $state, $line_nr, 1) if 
($Texi2HTML::Config::stop_paragraph_command{$next_tag} and 
!$state->{'keep_texi'});
             if (defined($next_tag) and 
defined($Texi2HTML::Config::misc_command{$next_tag}) and 
!$Texi2HTML::Config::misc_command{$next_tag}->{'keep'})
             {
                 $cline =~ s/^(\s*)address@hidden//;

Index: examples/info.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/examples/info.init,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- examples/info.init  24 Jan 2009 00:21:03 -0000      1.19
+++ examples/info.init  3 Feb 2009 12:32:39 -0000       1.20
@@ -232,6 +232,8 @@
 $format_list_item_texi = \&info_default_format_list_item_texi;
 $format             = \&info_default_format;
 $tab_item_texi      = \&info_default_tab_item_texi;
+$acronym_like       = \&info_default_acronym_like;
+$sp                 = \&info_default_sp;
 
 
 sub info_default_accent($$$)
@@ -268,10 +270,13 @@
     return $copying_text;
 }
 
-sub info_default_count_lines($)
+sub info_default_count_lines($$)
 {
       my $text = shift;
+      my $info_state = shift;
       my @lines = split /^/, $text;
+      # don't accept empty text.
+      @lines = ('') if (address@hidden);
       my $line_passed = scalar(@lines);
       $line_passed-- if ($line_passed);
       my $end_of_line = 0;
@@ -280,7 +285,11 @@
          $line_passed++;
          $end_of_line = 1;
       }
-      return ($line_passed, $end_of_line,$lines[-1]);
+      if (($#lines > 1) and !$end_of_line and ($lines[-1] !~ /\S/) and 
($lines[-2] !~ /\S/))
+      {
+         $info_state->{'blank_line'} = 1;
+      }
+      return ($line_passed, $end_of_line, $lines[-1]);
 }
 
 # FIXME initialize
@@ -344,6 +353,7 @@
    if (!$in_para)
    {
        my $chomped_text = $text;
+       chomp($chomped_text);
        if ($line_char_counter == 0 and $chomped_text ne '')
        {
            $text = $indent_text.$text;
@@ -445,10 +455,6 @@
    my $indent_text = '';
    $indent_text = ' ' x $indent_length if (defined($indent_length));
 
-   if ($line_char_counter == 0)
-   {
-      $pending_spaces = $indent_text . $pending_spaces;
-   }
    my $result = $pending_spaces;
    $pending_spaces = '';
    if (defined($pending_word))
@@ -456,6 +462,14 @@
       $result .= $pending_word;
       $pending_word = undef;
    }
+
+   my $chomped_result = $result;
+   chomp ($chomped_result);
+   if ($line_char_counter == 0 and $chomped_result ne '')
+   {
+      $result = $indent_text . $result;
+   }
+
    $line_char_counter += length($result);
    return ($line_char_counter, $pending_spaces, $pending_word, $result);
 }
@@ -498,7 +512,6 @@
    my $pending_word;
    my $preformatted = 0;
    my $indent_level = 0;
-   my $exdent_line = 0;
    my $item_pending;
    my $in_exdent = 0;
    my $in_para = 0;
@@ -511,8 +524,6 @@
       last if (!defined($current));
       my $content = $current->{'content'}->[$index];
       my $text_added = '';
-my  $waiting_for_line_text = 'undef';
-$waiting_for_line_text = $info_state->{'waiting_for_line'} if 
(defined($info_state->{'waiting_for_line'}));
 my $line_char_counter_text = 'undef';
 $line_char_counter_text = "$line_char_counter" if 
(defined($line_char_counter));
 my $text_length = '';
@@ -521,7 +532,7 @@
 $text_command = $content->{'command'} if defined($content->{'command'});
 my $in_node_count = 0;
 $in_node_count = $info_state->{'line_count'} if 
defined($info_state->{'line_count'});
-      print STDERR 
"($text_command|$text_length|$close|${all_line_passed}+$in_node_count) 
preformatted $preformatted, indent_lvl $indent_level exdent_line $exdent_line 
line_char_counter $line_char_counter_text waiting_for_line 
$waiting_for_line_text\n";
+      print STDERR 
"($text_command|$text_length|$close|${all_line_passed}+$in_node_count) 
preformatted $preformatted, indent_lvl $indent_level in_exdent $in_exdent 
line_char_counter $line_char_counter_text only_spaces 
$info_state->{'only_spaces'} blank_line $info_state->{'blank_line'}\n";
 my $pending_word_text = 'undef';
 $pending_word_text = "`$pending_word'" if (defined($pending_word));
 print STDERR "         spaces: `$pending_spaces' word: $pending_word_text\n";
@@ -547,23 +558,23 @@
               if ($info_default_indented_commands{$content->{'command'}})
               {
                   $indent_level--;
-                  # don't do that for quotations, quotations already have
-                  # end of paragraph end of lines.
                   $text_added = $content->{'end'} if 
defined($content->{'end'});
-                  if ($indent_level > 0 and 
$complex_format_map->{$content->{'command'}})
+                  if ($indent_level > 0 and !$info_state->{'blank_line'})
                   {
                      $text_added .= "\n";
                   }
-                  $info_state->{'waiting_for_line'} = 1 if ($indent_level == 
0);
                   goto new_text;
               }
               if ($content->{'command'} eq 'paragraph')
               {
+                  my $pending;
+                  ($line_char_counter, $pending_spaces, $pending_word, 
$pending) = info_default_store_pending($line_char_counter, $pending_spaces, 
$pending_word, $indent_length);
+                  $text_added = $pending if (defined($pending));
+                  $text_added =~ s/\s*$//;
                   $pending_spaces = '';
                   $in_para = 0;
                   $info_state->{'indent_para'} = undef;
-                  $text_added = "\n" unless ($line_char_counter == 0);
-                  $info_state->{'waiting_for_line'} = 1;
+                  $text_added .= "\n" unless (($line_char_counter + 
length($text_added)) == 0);
                   # FIXME needed?
                   goto new_text;
               }
@@ -579,21 +590,22 @@
       {
           if ($content->{'command'})
           { 
-              if ($content->{'command'} eq 'anchor' or $content->{'command'} 
eq 'image' or $content->{'command'} eq 'index_command')
+              my $pending_added_length = 0;
+              if ($content->{'command'} eq 'anchor' or $content->{'command'} 
eq 'image' or $content->{'command'} eq 'index_command' or $content->{'command'} 
eq 'sp')
               {
                   my $pending;
                   ($line_char_counter, $pending_spaces, $pending_word, 
$pending) = info_default_store_pending($line_char_counter, $pending_spaces, 
$pending_word, $indent_length);
                   # here spaces out of any environment are ignored.
-                  if ($in_para or $preformatted or $pending !~ /^\s*$/)
+                  if ($in_para or $preformatted or $pending =~ /\S/)
                   { # this has to be done before the anchor related code
                     # to have the right count.
-                      $length += length($pending);
-                      $result .= $pending;
+                      $pending_added_length += length($pending);
+                      $text_added .= $pending;
                   }
               }
               if ($content->{'command'} eq 'anchor')
               {
-                  $content->{'anchor_reference'}->{'info_offset'} = $length + 
$info_state->{'offset_in_file'};
+                  $content->{'anchor_reference'}->{'info_offset'} = $length + 
$info_state->{'offset_in_file'} + $pending_added_length;
                   push @{$info_state->{'pending_tags'}}, 
$content->{'anchor_reference'};
               }
               elsif ($content->{'command'} eq 'index_label')
@@ -637,12 +649,24 @@
               elsif ($content->{'command'} eq 'preformatted')
               {
                   $preformatted++;
-                  $in_exdent = 0;
               }
               elsif ($content->{'command'} eq 'exdent')
               {
+                  # if an end of line is added, in_exdent is set to 2 and
+                  # set to one when processing the end of line that was just
+                  # added, and set to 0 at the end of the line.
+                  # if there is no end of line added, it is only set to 1.
+                  if ($line_char_counter != 0)
+                  {
+                     $text_added .= "\n";
+                     $in_exdent = 2;
+                  } 
+                  else
+                  {
                   $in_exdent = 1;
               }
+                 goto new_text;
+              }
               elsif ($content->{'command'} eq 'indent')
               {
                   $info_state->{'indent_para'} = 1;
@@ -651,7 +675,7 @@
               {
                   $info_state->{'indent_para'} = 0;
               }
-              elsif ($content->{'command'} eq 'image')
+              elsif ($content->{'command'} eq 'image' or $content->{'command'} 
eq 'sp')
               {
                   $text_added .=  $content->{'text'};
                   goto new_text;
@@ -662,7 +686,10 @@
               }
               if ($info_default_indented_commands{$content->{'command'}})
               {
-                  $info_state->{'waiting_for_line'} = 0 if ($indent_level == 
0);
+                  if (!$info_state->{'blank_line'} and 
$info_state->{'only_spaces'} and ($indent_level != 0))
+                  {
+                     $text_added .= "\n";
+                  }
                   $indent_level++;
               }
           }
@@ -693,19 +720,16 @@
               else
               {
                   my $chomped_text = $content->{'text'};
-                  if ($chomped_text =~ /^\s*$/ and chomp($chomped_text))
+                  if ($chomped_text !~ /\S/ and chomp($chomped_text))
                   {
-                      if ($info_state->{'waiting_for_line'})
+                      if (!$info_state->{'blank_line'} and 
$info_state->{'only_spaces'})
                       {
-                           $text_added ="\n";
-                           $info_state->{'waiting_for_line'} = 0;
-                  #         $text_added .= "\n" if ($line_char_counter != 0);
+                           $text_added .= "\n";
                       }
                   }
                   else
                   { # exdent, item not in paragraph nor in preformatted
                        $text_added .= $content->{'text'};
-                       $info_state->{'waiting_for_line'} = 0;
                   }
               }
 # unless (!defined($line_char_counter) and !$preformatted and 
$content->{'text'} =~ /^\s*$/);
@@ -721,9 +745,13 @@
       else
       {
           my $chomped_text = $text_added;
+          #if (chomp($chomped_text))
+          #{
+          #    $in_exdent = 0;
+          #}
           chomp($chomped_text);
 print STDERR "text_added `$text_added' line_char_counter $line_char_counter\n";
-          if ($text_added ne '' and $chomped_text ne '' and $line_char_counter 
== 0)
+          if ($chomped_text ne '' and $line_char_counter == 0)
           {
 print STDERR "                     indent_length $indent_length\n";
               $text_added =  ' ' x $indent_length.$text_added;
@@ -737,20 +765,18 @@
       if ($text_added ne '')
       {
          $item_pending = undef;
-         if ($exdent_line)
-         {
-             $exdent_line = 0;
-             $in_exdent = 1;
-         }
       }
       $result .= $text_added;
       $length += length($text_added);
-      my ($line_passed, $end_of_line, $last_line) = 
info_default_count_lines($text_added);
-
+      $info_state->{'blank_line'} = 0 if ($text_added =~ /\S/);
+      my ($line_passed, $end_of_line, $last_line) = 
info_default_count_lines($text_added, $info_state);
+      # only_space is checked in all the conditionals
       if ($end_of_line)
       {
          $line_char_counter = 0;
-         $in_exdent = 0;
+         $in_exdent-- if ($in_exdent);
+         $info_state->{'blank_line'} = 1 if ($info_state->{'only_spaces'} and 
($last_line !~ /\S/));
+         $info_state->{'only_spaces'} = 1;
       }
       else
       {
@@ -758,6 +784,19 @@
          {# in that case we added more than one line, the $line_char_counter
           # is reset to the last line length.
             $line_char_counter = length($last_line);
+            $in_exdent = 0;
+            if ($last_line !~ /\S/)
+            {
+               $info_state->{'only_spaces'} = 1;
+            }
+            else
+            {
+               $info_state->{'only_spaces'} = 0;
+            }
+         }
+         else
+         {
+            $info_state->{'only_spaces'} = 0 if ($last_line =~ /\S/);
          }
       }
       $all_line_passed += $line_passed;
@@ -775,6 +814,11 @@
       my ($current_command, $top_stack);
       $info_default_state_map{$state} = {};
       info_default_reset_state($info_default_state_map{$state});
+      # since the page head always leave a blank line, and the state may be
+      # used for text right after the page head, we set it to 1 here. 
+      # it may be wrong in other contexts, to be seen.
+      $info_default_state_map{$state}->{'blank_line'} = 1;
+      $info_default_state_map{$state}->{'only_spaces'} = 1;
       $info_default_state_map{$state}->{'nr'} = $state_nr;
       $info_default_state_map{$state}->{'state'} = $state;
       $state_nr++;
@@ -1061,6 +1105,7 @@
     my $state = $Texi2HTML::THISDOC{'state'};
     my $info_state = info_default_get_state ($state);
     $info_state->{'offset_in_file'} = length($result);
+    $info_state->{'blank_line'} = 1 if ($Texi2HTML::THISDOC{'copying_comment'} 
eq '');
     print $fh $result;
 }
 
@@ -1148,6 +1193,7 @@
     $result .= "\n\n";
     $info_state->{'line_count'} = 3;
     $info_state->{'offset_in_file'} += length($result);
+    $info_state->{'blank_line'} = 1;
     return $result;
 }
 
@@ -1215,19 +1261,17 @@
     $text = "Annexe $text" if ($element->{'tag'} =~ /appendix/ and 
$element->{'level'} <= 1);
     my $heading = $text . "\n" . 
        ($default_info_level_to_symbol{$element->{'level'}} x length($text)) . 
"\n";
-    if (length($text))
+    if (!$info_state->{'blank_line'})
     {
-       $heading .= "\n";
+       $heading = "\n" .$heading;
        $info_state->{'line_count'}++;
     }
-    if ($info_state->{'waiting_for_line'})
+    if (length($text))
     {
-       $heading = "\n" .$heading;
-       $info_state->{'waiting_for_line'} = 0;
+       $heading .= "\n";
        $info_state->{'line_count'}++;
+       $info_state->{'blank_line'} = 1;
     }
-    # FIXME use state for headings appearing somewhere strange. + maybe
-    # waiting_for_line should also be used for headings
     $info_state->{'offset_in_file'} += length($heading);
     $info_state->{'line_count'} += 2;
     return $heading;
@@ -1381,12 +1425,11 @@
     my $nw = main::print_lines($fh);
     my $state = $Texi2HTML::THISDOC{'state'};
     my $info_state = info_default_get_state ($state);
-    if ($info_state->{'waiting_for_line'})
+    if (!$info_state->{'blank_line'})
     {
        my $end = "\n";
        $info_state->{'offset_in_file'} += length($end);
        $info_state->{'line_count'}++;
-       $info_state->{'waiting_for_line'} = 0;
        print $fh "$end";
     }
     if (@info_default_pending_footnotes)
@@ -1435,7 +1478,7 @@
                $line = shift @$lines;
                $footnote_result .= $line;
             }
-            my ($line_passed, $end_of_line, $last_line) = 
info_default_count_lines($footnote_result);
+            my ($line_passed, $end_of_line, $last_line) = 
info_default_count_lines($footnote_result, $info_state);
             if ($line_passed == 0)
             {# certainly out of paragraph commands
                $footnote_result =~ s/\s*$//;
@@ -1485,11 +1528,10 @@
     my $text = shift;
     my $info_state = info_default_get_state ($state);
     my $end = '';
-    if ($info_state->{'waiting_for_line'})
+    if (!$info_state->{'blank_line'})
     {
        $end = "\n";
        $info_state->{'offset_in_file'} += length($end);
-       $info_state->{'waiting_for_line'} = 0;
     }
     return $text.$end;
 }
@@ -1741,18 +1783,19 @@
     my $state = $Texi2HTML::THISDOC{'state'};
     my $info_state = info_default_get_state ($state);
     my $before = '';
-    if ($info_state->{'waiting_for_line'})
+    if (!$info_state->{'blank_line'})
     {
        $before = "\n";
        $info_state->{'offset_in_file'} += length($before);
        $info_state->{'line_count'}++;
-       $info_state->{'waiting_for_line'} = 0;
+       $info_state->{'blank_line'} = 1;
     }
     return $before if (!defined($text));
     my $result = "\x{00}\x{08}[index\x{00}\x{08}]\n* Menu:\n\n" .$text."\n";
     $info_state->{'offset_in_file'} += length($result);
-    # FIXME set waiting_for_line?
-    my ($line_passed, $end_of_line, $last_line) = 
info_default_count_lines($result);
+
+    my ($line_passed, $end_of_line, $last_line) = 
info_default_count_lines($result, $info_state);
+    $info_state->{'blank_line'} = 1 if ($last_line !~ /\S/ and $end_of_line);
     $info_state->{'line_count'} += $line_passed;
     return $before.$result;
 }
@@ -1957,4 +2000,14 @@
    return undef;
 }
 
+sub info_default_sp($$)
+{
+   my $number = shift;
+   my $preformatted = shift;
+   my $result = "\n" x $number;
+   my $state = $Texi2HTML::THISDOC{'state'};
+   return info_default_store_text($state,$result,'sp');
+}
+
+
 1;

Index: test/coverage/res/comments/comments.html
===================================================================
RCS file: 
/cvsroot/texi2html/texi2html/test/coverage/res/comments/comments.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- test/coverage/res/comments/comments.html    18 Jan 2009 00:59:31 -0000      
1.7
+++ test/coverage/res/comments/comments.html    3 Feb 2009 12:32:39 -0000       
1.8
@@ -143,15 +143,14 @@
 <p>@exdent line after exdent
 </p>
 <p>And now sp:
-Text line followed by a comment on the same line and another below <br>
+Text line followed by a comment on the same line and another below </p><br>
 <br>
 <br>
-Text line after the comment followed by a comment <br>
-Text line after the text line followed by the comment.
+<p>Text line after the comment followed by a comment </p><br>
+<p>Text line after the text line followed by the comment.
+</p><br>
 <br>
-<br>
-a number after sp
-</p>
+
 
 <p>A &rArr; (result).
 </p>

Index: test/encodings/Makefile.am
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/encodings/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- test/encodings/Makefile.am  2 Jan 2009 14:55:54 -0000       1.6
+++ test/encodings/Makefile.am  3 Feb 2009 12:32:39 -0000       1.7
@@ -3,6 +3,7 @@
  weird_accents.texi accentenc.texi \
  accent-text.txi ogolat2.texi  ogoutf.texi \
  at_commands_in_refs_latin1.texi at_commands_in_refs_utf8.texi \
+ japanese.texi \
  no_unicode.init no_unidecode.init icons.init tests.txt res
 
 DISTCLEANFILES = l2h_tmp_dir.init tests.log tests.out

Index: test/encodings/tests.txt
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/encodings/tests.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- test/encodings/tests.txt    9 Jan 2009 16:55:20 -0000       1.4
+++ test/encodings/tests.txt    3 Feb 2009 12:32:39 -0000       1.5
@@ -48,3 +48,4 @@
 ogolat2 ogolat2.texi
 ogoutf ogoutf.texi
 nodetest_info nodetest.texi -init info.init
+japanese japanese.texi

Index: test/formatting/Makefile.am
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/formatting/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- test/formatting/Makefile.am 2 Jan 2009 04:22:29 -0000       1.11
+++ test/formatting/Makefile.am 3 Feb 2009 12:32:40 -0000       1.12
@@ -8,7 +8,7 @@
  images.texi index_in_item_line_table.texi index_in_item_line_vtable.texi \
  index_in_item_line_table_in_code.texi table_in_table_item.texi \
  nested_formats.texi inter_item_commands.texi multitables.texi \
- double_style_paragraph.texi \
+ double_style_paragraph.texi at_command_glued.texi test_sp.texi \
  f--ile.gif f--ile.jpeg f--ile.png f---ile.gr--a f--ile.jpg f--ile.txt \
  simple_menu.init weird_quotes.init redefine_need.init file.css tests.txt res
 

Index: test/formatting/tests.txt
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/formatting/tests.txt,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- test/formatting/tests.txt   1 Jan 2009 22:35:18 -0000       1.10
+++ test/formatting/tests.txt   3 Feb 2009 12:32:40 -0000       1.11
@@ -32,6 +32,8 @@
 texi nested_formats.texi
 texi inter_item_commands.texi
 texi double_style_paragraph.texi
+texi at_command_glued.texi
+texi test_sp.texi
 # for makeinfo
 texi ../coverage/formatting.texi -U texi2html
 def_cmds def_cmds.texi
@@ -84,4 +86,8 @@
 inter_item_commands_xml inter_item_commands.texi -init xml.init
 inter_item_commands_docbook inter_item_commands.texi -init docbook.init
 double_style_paragraph double_style_paragraph.texi
+at_command_glued at_command_glued.texi
+test_sp test_sp.texi
+at_command_glued_info at_command_glued.texi -init info.init
+test_sp_info test_sp.texi -init info.init
 #formatting_info ../coverage/formatting.texi -init info.init

Index: test/formatting/res/comments_redefine_need/comments.html
===================================================================
RCS file: 
/cvsroot/texi2html/texi2html/test/formatting/res/comments_redefine_need/comments.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- test/formatting/res/comments_redefine_need/comments.html    18 Jan 2009 
00:59:31 -0000      1.7
+++ test/formatting/res/comments_redefine_need/comments.html    3 Feb 2009 
12:32:40 -0000       1.8
@@ -147,15 +147,14 @@
 <p>@exdent line after exdent
 </p>
 <p>And now sp:
-Text line followed by a comment on the same line and another below <br>
+Text line followed by a comment on the same line and another below </p><br>
 <br>
 <br>
-Text line after the comment followed by a comment <br>
-Text line after the text line followed by the comment.
+<p>Text line after the comment followed by a comment </p><br>
+<p>Text line after the text line followed by the comment.
+</p><br>
 <br>
-<br>
-a number after sp
-</p>
+
 
 <p>A &rArr; (result).
 </p>

Index: test/encodings/japanese.texi
===================================================================
RCS file: test/encodings/japanese.texi
diff -N test/encodings/japanese.texi
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/encodings/japanese.texi        3 Feb 2009 12:32:39 -0000       1.1
@@ -0,0 +1,41 @@
+\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
address@hidden UTF-8
address@hidden lilypond-learning.info
address@hidden GNU LilyPond -- Manuel d'initiation
+
address@hidden ja
+
address@hidden Top
address@hidden GNU LilyPond --- 学習マニュアル
+
address@hidden
+Copyright @copyright{} 1999--2008 著作者一同
+
address@hidden translation of the following copyright notice is provided
+for courtesy to non-English speakers, but only the notice in English
+legally counts.}
+
address@hidden
+英語で書かれた注意書きだけが法的に有効です。}
address@hidden copying
+
+
+これは GNU LilyPond バージョン 
+
address@hidden
+* Preface::
+* Introduction::                   LilyPond とは何なのか、なぜ 
LilyPond を使うのか、どうやって LilyPond を使うのか
address@hidden menu
+
address@hidden Preface
address@hidden Preface
+
+それは 1995 年のある日の EJE (Eindhoven Youth Orchestra) 
のリハーサル中のできごとでした − ある変わり者
のバイオリン奏者であるジャンは同じく変わり者
のフレンチホルン奏者
のハン-ウェンに彼がかかわっている新しい大きなプロジェクトのことを話しました。それは音楽を出版するための自動化されたシステãƒ
 ã§ã™ (正確には、それは MPP − MusiXTeX 
のプリプロセッサです)。それを聞いてハン-ウェンはすぐに楽譜からいくつかの部分をプリントアウトしたいと思い、彼はそのためのソフトウェアを探し始め、すぐにその虜になってしまいました。それが
 MPP 
の終わりを決定付けました。多くの哲学的考察を含み白熱した
 email の交換の後、ハン-ウェンは 1996 年に LilyPond 
の製作を開始しました。この時、ジャンはハン-ウェンの新しいプロジェクトに引きずり込まれました。
+
+
address@hidden Introduction
address@hidden Introduction
+
+この章では読者に LilyPond 
とこのドキュメントについての紹介を行います。
+
address@hidden

Index: test/formatting/at_command_glued.texi
===================================================================
RCS file: test/formatting/at_command_glued.texi
diff -N test/formatting/at_command_glued.texi
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/formatting/at_command_glued.texi       3 Feb 2009 12:32:40 -0000       
1.1
@@ -0,0 +1,41 @@
+\input texinfo.tex    @c -*-texinfo-*-
+
address@hidden at_command_glued.info
+
address@hidden Top
address@hidden @@-commmands with some text preceding and following them
+
+at@@.
address@hidden
address@hidden code}code.
address@hidden, aaa bb cc}acronym.
address@hidden
address@hidden, mali}email.
address@hidden
address@hidden footnote}after footnote.
address@hidden@dotless{i}}accent.
+and address@hidden
address@hidden after noindent
address@hidden 4
address@hidden
address@hidden index
+
+in example
address@hidden
+at@@.
address@hidden
address@hidden code}code.
address@hidden, aaa bb cc}acronym.
address@hidden
address@hidden, mali}email.
address@hidden
address@hidden footnote}after footnote.
address@hidden@dotless{i}}accent.
+and address@hidden
address@hidden after noindent
address@hidden 4
address@hidden ex}anchor
address@hidden index ex
address@hidden example
+
address@hidden

Index: test/formatting/test_sp.texi
===================================================================
RCS file: test/formatting/test_sp.texi
diff -N test/formatting/test_sp.texi
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/formatting/test_sp.texi        3 Feb 2009 12:32:40 -0000       1.1
@@ -0,0 +1,33 @@
+\input texinfo.tex    @c -*-texinfo-*-
+
address@hidden test_sp.info
+
address@hidden Top
address@hidden Test @@sp
+
+Para
address@hidden 1
+other para
+Now lone @@sp:
+
address@hidden 1
+
address@hidden 2
+Para after sp
+
+sp after para
address@hidden 1
+
address@hidden
+Para
address@hidden 1
+other para
+Now lone @@sp:
+
address@hidden 1
+
address@hidden 2
+Para after sp
address@hidden example
+
address@hidden




reply via email to

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