Le 18 oct. 2006 à 17:37, John Gruber a écrit :

Jacob Rus <[EMAIL PROTECTED]> wrote on 10/18/06 at 12:13 PM:

Incidentally, I don't think that we need any more explicit
symbolic marker for code blocks.  One of the things I most
like about markdown's syntax is that a simple indentation puts
us into a code block, without any unnecessary clutter.

It would be in addition to the current syntax, and should remain
out of your way if you don't like it.

Me thinking about Markdown Extra: if you're using the colon for that as previously suggested, you're breaking the definition list syntax:

    Hello there!

    :   Is this some code or a definition?

So I will suggest something else.

It's not uncommon to see unindented code samples in email and elsewhere denoted by a simple separator line -- I've got an impressive number of bug reports for PHP Markdown formatted this way. So we could build on that and introduce an unindented code block syntax with a separator line. While the aesthetics are not as good as indented code blocks, that syntax could prove handy when indentation is not very practical (like, say, pasting a big code sample in a web form).

So I propose this as an alternative code block syntax:

    ~~~
    function db_like($first, $pattern) {
        $pattern = preg_quote($pattern);
        $pattern = preg_replace('/(?<!\\)_/', '.', $pattern);
        $pattern = preg_replace('/(?<!\\)%/', '.*?', $pattern);
        return preg_match('{^'.$pattern.'$}', $first);
    }
    ~~~

The code block begins with three or more consecutive tildes `~` alone on a line, and ends with the same number of tildes `~` alone on a line.


Michel Fortin
[EMAIL PROTECTED]
http://www.michelf.com/


_______________________________________________
Markdown-Discuss mailing list
[email protected]
http://six.pairlist.net/mailman/listinfo/markdown-discuss

Reply via email to