Code blocks, the colon and French

John Gruber gruber at fedora.net
Tue Mar 16 22:52:20 EST 2004


John Gruber <gruber at fedora.net> wrote on 03/16/04 at 7:33p:

> The simplest rule for code blocks would be to change it to this:
> 
> *   Code blocks are indented by 4 spaces or 1 tab.
> 
> And that's it. I think that would be much more Markdown-like.
> You could put whatever you wanted before a code block, colon,
> space-colon, whatever.

I forgot. There's one more reason why I didn't implement it this way
already. I'm worried people inserting inline HTML with indents, and
having it turned into a code block accidentally.

The syntax docs already state that the start tag for an inline HTML
block should not be indented.

<div class='foo'>
    <span>
        You can indent all you want in here.
    </span>
</div>

Thus, the above will always be treated as raw inline HTML.

    <div class='foo'>
        <span>
            You can indent all you want in here.
        </span>
    </div>

With the new rule, that second div, which has no preceding colon,
will be treated as a code block.

I think this makes sense, and is fair. But I'm worried about
copy-paste bugs, where someone will copy the raw HTML they want to
insert out of some other window, paste it into their Markdown
article, and forget that the start tag can't be indented.

Thoughts?

-J.G.


More information about the Markdown-discuss mailing list