Syntax Questions

Michel Fortin michel.fortin at michelf.com
Fri Jul 18 07:18:07 EDT 2008


Le 2008-07-18 à 5:13, Jurgens du Toit a écrit :


> Kewl.

>

> If you look at a formatter like tidy, it's got a lot of options

> where you

> can turn certain behaviour on and off, making it much more useable

> for a lot

> of people. Wouldn't it improve the usability of Markdown if these

> kind of

> options were present?


The more options, the more difficult to test, because each input can
have more than one output. There are some configurable things in PHP
Markdown, but I can attest they are under-tested compared to the
regular syntax.

Moreover, with each option affecting how the Markdown source is
parsed, you multiply per two the number of variants of the language in
the wild. Currently, if I encounter a text box on a web page claiming
to be Markdown-formatted I can be pretty sure of the output I'll get
for what I write. If Markdown had one option turning each newline in
one HTML line break, then writing in that textbox is guesswork.
Hopefully, the form author will tell which options are on and which
are off -- something like "Markdown + automatic line breaks" in our
case -- but the more options, the less practical it is for authors to
write this extra info, or for users to read it, because the length of
the description would become intimidating.

Which means that if you modify Markdown to change some of its
behaviour, please don't call it plainly "Markdown". "Markdown +
automatic line breaks" explains clearly what your text field does
differently from Markdown and will avoid surprises for your visitors.

- - -

Now, if you still want to do a hard break at each newline with PHP
Markdown, go to the `doHardBreaks` function and change this expression:

/ {2,}\n/

for this one:

/\n/

and I expect it should do the trick. This is totally untested however.
And I don't plan to add an option like this to future versions.


Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Markdown-Discuss mailing list