Data loss issue: Adjacent List Types

Lasar Liepins lasar at liepins.net
Mon Jun 6 13:57:28 EDT 2011


Hello,

while I agree that this is technically an issue, I don't think it
is an often seen issue in actual human-written text. Markdown is
plain text formatted by and for humans. I don't think there are
many cases where you would want to put two lists after each other
without an introduction of sorts.

And on a side note: Gruber notes in the markdown spec that the
actual numbers used in a numbered list are ignored. So data loss
is already occuring here.

Greetings,

_Lasar

On 2011-06-06, at 19:20, Alan Hogan wrote:


> Esteemed human authors and robotic parse-bots:

>

> I recently discovered that most or all Markdown implementations, including Gruber’s original in Perl, have an odd behavior with regards to lists that follow each other. Namely, a bulleted list followed by a numbered list, or vice-versa, is masked as if it were part of the first list (and of the first list’s type.)

>

> For example, consider the following input:

>

> ~~~~~~

>

> - Bulleted item

> - Second bulleted item

>

> 1. Numbered list

> 2. Second numbered item

>

> ~~~~~~

>

> It will yield an output of one UL element with four LI children (themselves containing some number of P tags, varying by implementation).

>

> Now, I realize full well that a blank line between list items causes the list items to be given <p> tags. But the blank line above, to any reasonable *human*, isn’t separating list items but rather *lists.*

>

> There is a fundamental problem in the above code: that it triggers **non-obvious data loss.**

>

> The data is of course the numbering.

>

> The non-obviousness is due to the way the output formatting is essentially correct, and only the list item markers are unexpected. A cursory scan of the Markdown-transformed text — e.g., looking over a blog post before publishing — will show no structural problems. Success, publish! … How long until the author realizes his/her reference to “step #2” is actually referring to the fourth bullet in an awkward list?

>

> One of the nicest things about Markdown is that once you get it, and it doesn’t take long, then there is precious little by way of surprises it will throw at you.

>

> If for no other reason, I think the counter-intuitiveness and “crap do I really have to remember that you can’t follow a list by a list” moment are in and of themselves reasons to change the behavior. Besides the data loss.

>

> I also struggle to imagine anyone who would be upset at the change. After all, what end-user would *rely* on this feature to munge their list types?

>

> Alan

>

> _______________________________________________

> Markdown-Discuss mailing list

> Markdown-Discuss at six.pairlist.net

> http://six.pairlist.net/mailman/listinfo/markdown-discuss




--
_Lasar Liepins
lasar at liepins.net
http://liepins.net/
http://10110101.net/



More information about the Markdown-Discuss mailing list