in reply to •Re: Code that contains </code>
in thread Code that contains </code>

so it looks like the Everything2 engine is adding extra newlines inside the PRE element.

What you're seeing is the rather poorly documented behavior of <pre> when there's a newline somewhere between the tags.

No, that's me on crack dust.

  • Comment on Re: &bull;Re: Code that contains </code>

Replies are listed 'Best First'.
Re^3: Code that contains </code> (bull)
by tye (Sage) on Aug 05, 2003 at 22:15 UTC

    Just to be clear, PRE and P are "block" tags so if I use

    <pre>line1\nli</pre><pre>ne2\nline3</pre>
    or
    <p>line1\nli</p><p>ne2\nline3</p>
    (where \n is a real newline), the middle close+open don't just disappear:
    line1
    li
    ne2
    line3
    I see two blocks with a blank line between them.

    CODE tags where there is a newline in the code become a block. CODE tags that contain no newlines do not become a block. So a close+open is invisible if there are no newlines in either chunk of code. A close+open cannot become invisible for a block unless we special-case it. That would surprise people who expect them to work like other block tags.

                    - tye
•Re: Re: •Re: Code that contains </code>
by merlyn (Sage) on Aug 05, 2003 at 22:04 UTC
      The point of PRE is to preserve all whitespace. Newline is whitespace.

      Indeed. But if there's a newline within a <pre> block, browsers will render that line with an extra blank line on the top. Try it.

      Sigh. Someone slipped crack into my coffee.