Code blocks, the colon and French

John Gruber gruber at
Tue Mar 16 19:33:31 EST 2004

Michel Fortin <michel.fortin at> wrote on 03/16/04 at 3:42p:

> I suppose that's great, but half of my website is in French. The 
> problem is that the code block syntax is somewhat "incompatible" with 
> the French typographical standard that tend to also put a space 
> *before* the colon.

OK, I understand. I did not know that. This is exactly the sort of
feedback I was hoping to get during the public beta.

> May I suggest that a change to this rule:
> > If you don’t want a colon to appear in your HTML output, put a space 
> > before it.
> for this rule:
> > If you don’t want a colon to appear in your HTML output, put any 
> > ponctuation mark before it.
> This would keep most of the current syntax untouched while still 
> allowing to put a space before the colon.
> > A regular paragraph, without a colon. :
> >
> >     This is a code block.
> >
> > A regular paragraph, with a colon :
> >
> >     This is a code block.
> So what do you think?

That's not bad. I'll keep it under consideration.

The bigger picture, though, is that the "colon before code blocks"
rule is my least favorite element in the entire syntax. I think it's
just sort of weird, because doing things like:

    Blah blah blah. :
        code here


    Blah blah blah.
        code here

seems like exactly the sort of typotag pseudomarkup junk that
Markdown is supposed to avoid. Markdown's syntax is supposed to be
natural, but using colons like in the above examples is decidedly

It's also the case that this was, by far, the hardest rule to
describe in the documentation. That's a good rule of thumb for
determining that a feature is too complicated and ought to be

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.

The only reason I *haven't* done this is that I'm wondering if I
might want to use indentation for some other purpose, in addition to
code blocks -- in which case the "colon rule", or some variation on
it, will be needed to differentiate. In other words, I decided it
would be better to make it strict in the first few beta releases,
and then maybe relax the rule before 1.0 final.

List items use indentation for extra paragraphs in list items, but
Markdown can already tell them apart from indentation used for code

So, the probable answer is that code blocks will drop the "colon"
rule, unless someone comes up with another good use for indented

John Gruber          |              Daring Fireball
gruber at    |

More information about the Markdown-discuss mailing list