in reply to Code that contains </code>

Simple:
print "</co</co
de><code>de>"; update: Or at least, that should have worked, but a /code..code pair inserts extra blank lines for me. Stupid rendering engine. Where do I point at to fix that? The HTML looks like:
<pre><tt class="code"><font size="-1"> print &quot;&lt;/co&lt;/co </font></tt></pre> <tt><font size="-1">de&gt;&lt;co</font></tt><pre><tt class="code"><fon +t size="-1">de&gt;de&gt;&quot;; </font></tt></pre>
so it looks like the Everything2 engine is adding extra newlines inside the PRE element. Bad. I was trying to print:
print "</co</code><code>de>";

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: &bull;Re: Code that contains </code>
by dws (Chancellor) on Aug 05, 2003 at 21:57 UTC
    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.

      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
        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.