Block quotes with a blank line between them get merged
John Gruber
gruber at fedora.net
Thu Oct 19 00:30:37 EDT 2006
Michel Fortin <michel.fortin at michelf.com> wrote on 10/18/06 at
8:07 PM:
> Me thinking about Markdown Extra: if you're using the colon
>for that as previously suggested, you're breaking the
>definition list syntax:
I forgot about that, and I do like that syntax. I'm not married to
":" in particular as the second code-block marker. One thing I do
remember was that the reason I took it out, rather than adding
indentation in addition to it, was that I remember thinking that
":" might be a useful character to save for something else.
> ~~~
> 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.
I don't hate it, but it's not doing it for me. If you're going to
have stuff on separate lines like that, why not just use
`<pre><code>` and `</code></pre>`?
And don't forget that we'd need some sort of escape so that you
could put a literal `~~~` line in a code block.
I'd rather have line prefixes. I know they're harder to generate
in textarea fields, because you have to do them by hand, but I'm
finding it harder and harder to care about the plight of the
textarea-field-writer.
~ function db_like($first, $pattern) {
~ $pattern = preg_quote($pattern);
~ $pattern = preg_replace('/(?<!\\)_/', '.', $pattern);
~ $pattern = preg_replace('/(?<!\\)%/', '.*?', $pattern);
~ return preg_match('{^'.$pattern.'$}', $first);
~ }
One nice thing about '~' is that (on U.S. keyboards at least) it's
on the same key as '`' -- so you'd use the same key for inline
code spans as for code blocks.
-J.G.
More information about the Markdown-Discuss
mailing list