Pre tags in comments

Monday 21 July 2008

Just a quick note: after far too long, the comments on this blog now support the <pre> tag so we can talk about code if need be. Thanks for your patience!

Comments

[gravatar]
Jared 4:18 PM on 21 Jul 2008

sounds 
    good,
        thanks!

[gravatar]
Tim 10:11 PM on 21 Jul 2008

Why not use the <code> element for code?


# Using code element
import this
if 1:
print 'abc'

# Using pre element
import that
if 1:
    print 'abc'

[gravatar]
susan senator 4:56 AM on 22 Jul 2008

That's good news, because I thought I was coming down with a code...

[gravatar]
Ned Batchelder 5:45 AM on 22 Jul 2008

I didn't use <code> because it's one of those relics from HTML that I forgot even existed. Why not use <samp>? <pre> covers it all, and has the advantage that it also implies not flowing text, which is important. I wanted to give people *a* way to do what they need, not *all* ways.

[gravatar]
Tim 6:01 AM on 22 Jul 2008

Sorry, was just meant to be a friendly suggestion.

:-)
BTW, from the HTML spec: SAMP:
Designates sample output from programs, scripts, etc.
/anal

Anyway, please don't let my noise distract from your excellent blog.

[gravatar]
Adriano 6:51 AM on 22 Jul 2008

And anyway, I think <code> is supposed to be used for inline text, not for blocks. If I remember correctly, at least.

[gravatar]
Robert Kieffer 7:23 AM on 22 Jul 2008

                  _______                         ________________________
                 /    ___\_             o  O  O _( I wonder if Ned knows  )____
                /====(_____\___---_  o        _(  that he's opened up his blog )
               |                    \        (_ to all kinds of abuse.  ______)
               |                     |@        (_______________________)
                \       ___         /
   \ __----____--_\____(____\_____/
  ==|__----____--______|
   /              /    \____/)_
                /        ______)
               /           |  |
              |           _|  |
         ______\______________|______
        /                    *   *   \
       /_____________*____*___________\
       /   *     *                    \
      /________________________________\
      / *                              \
     /__________________________________\
          |                        |
          |________________________|
          |                        |
          |________________________|

[gravatar]
Tim 8:00 AM on 22 Jul 2008

@Adriano

You are quite right. I'll shut up now.

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.