bug-texinfo
[Top][All Lists]
Advanced

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

Re: [cvs] html for @example and @verbatiminclude


From: Karl Berry
Subject: Re: [cvs] html for @example and @verbatiminclude
Date: Mon, 20 Oct 2003 18:44:14 -0400

    There is also a problem with @verbatiminclude inside an @example
    environment [...]
    The indentation of the first real line of text is missing, and there
    are two additional lines before the verbatiminclude text (again in
    Mozilla 1.4).

Thanks for this report too.  I hope the below works without disturbing
normal output.  It's hard to know exactly what the right thing is.

BTW, it seems odd that
<pre>outer
    <pre>inner
</pre></pre>
doesn't have "inner" indented (because of the outer <pre>).  But somehow
it doesn't.  Whatever ...

k


Index: cmds.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.19
diff -c -r1.19 cmds.c
*** cmds.c      25 Sep 2003 18:06:52 -0000      1.19
--- cmds.c      20 Oct 2003 22:27:21 -0000
***************
*** 1330,1336 ****
    if (macro_expansion_output_stream && !executing_string)
      me_append_before_this_command ();
  
!   close_paragraph ();
    get_rest_of_line (0, &arg);
    /* We really only want to expand @value, but it's easier to just do
       everything.  TeX will only work with @value.  */
--- 1330,1338 ----
    if (macro_expansion_output_stream && !executing_string)
      me_append_before_this_command ();
  
!   if (!insertion_stack)
!     close_paragraph ();  /* No blank lines etc. if not at outer level.  */
!     
    get_rest_of_line (0, &arg);
    /* We really only want to expand @value, but it's easier to just do
       everything.  TeX will only work with @value.  */
Index: insertion.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/insertion.c,v
retrieving revision 1.29
diff -c -r1.29 insertion.c
*** insertion.c 20 Oct 2003 17:00:22 -0000      1.29
--- insertion.c 20 Oct 2003 22:27:22 -0000
***************
*** 1219,1225 ****
    int save_filling_enabled = filling_enabled;
    int save_inhibit_paragraph_indentation = inhibit_paragraph_indentation;
  
!   close_single_paragraph ();
    inhibit_paragraph_indentation = 1;
    filling_enabled = 0;
    in_fixed_width_font++;
--- 1218,1225 ----
    int save_filling_enabled = filling_enabled;
    int save_inhibit_paragraph_indentation = inhibit_paragraph_indentation;
  
!   if (!insertion_stack)
!     close_single_paragraph (); /* no blank lines if not at outer level */
    inhibit_paragraph_indentation = 1;
    filling_enabled = 0;
    in_fixed_width_font++;
***************
*** 1231,1237 ****
     */
  
    if (html)
!     add_word ("<pre class=\"verbatim\">");
  
    while (input_text_offset < input_text_length)
      {
--- 1231,1246 ----
     */
  
    if (html)
!     { /* If inside @example, we'll be preceded by the indentation
!          already.  Browsers will ignore those spaces because we're about
!          to start another <pre> (don't ask me).  So, wipe them out for
!          cleanliness, and re-insert.  */
!       int i;
!       kill_self_indent (default_indentation_increment);
!       add_word ("<pre class=\"verbatim\">");
!       for (i = current_indent; i > 0; i--)
!         add_char (' ');
!     }
  
    while (input_text_offset < input_text_length)
      {
***************
*** 1239,1247 ****
  
        if (character == '\n')
          line_number++;
!       /*
!         Assume no newlines in END_VERBATIM
!       */
        else if (find_end_verbatim && (character == COMMAND_PREFIX) /* @ */
            && (input_text_length - input_text_offset > sizeof (END_VERBATIM))
            && !strncmp (&input_text[input_text_offset+1], END_VERBATIM,
--- 1248,1255 ----
  
        if (character == '\n')
          line_number++;
! 
!       /* Assume no newlines in END_VERBATIM. */
        else if (find_end_verbatim && (character == COMMAND_PREFIX) /* @ */
            && (input_text_length - input_text_offset > sizeof (END_VERBATIM))
            && !strncmp (&input_text[input_text_offset+1], END_VERBATIM,
***************
*** 1266,1272 ****
      warning (_("end of file inside verbatim block"));
  
    if (html)
!     add_word ("</pre>");
    
    in_fixed_width_font--;
    filling_enabled = save_filling_enabled;
--- 1274,1283 ----
      warning (_("end of file inside verbatim block"));
  
    if (html)
!     { /* See comments in example case above.  */
!       kill_self_indent (default_indentation_increment);
!       add_word ("</pre>");
!     }
    
    in_fixed_width_font--;
    filling_enabled = save_filling_enabled;




reply via email to

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