fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
307 stars 59 forks source link

Possible bug with empty lines in lists #60

Closed mn4367 closed 10 years ago

mn4367 commented 10 years ago

This code

- Listitem 1
- Listitem 2
- Listitem 3

produces this HTML:

<ul>
<li>Listitem 1</li>
<li>Listitem 2</li>
<li>Listitem 3</li>
</ul>

But this code

- Listitem 1
- Listitem 2

- Listitem 3

produces the follwing HTML:

<ul>
<li><p>Listitem 1</p></li>
<li><p>Listitem 2</p></li>
<li><p>Listitem 3</p></li>
</ul>

Is there a reason, why all the list items are now wrapped in <p>-Tags? I'd consider this a bug, unless it is meant as a feature (but what is the pupose?). The behavior is the same for unordered and ordered lists.

Normally this isn't visible in a browser, but if somebody defines a line height via CSS of, say 1.5em, the list looks different.

fletcher commented 10 years ago

This is (almost) standard Markdown behavior. The only difference is that Markdown.pl doesn't wrap the first paragraph in a <p>.

mn4367 commented 10 years ago

OK, thanks, but wouldn't it be better then to enable this behavior only when --compatibility is used?

fletcher commented 10 years ago

This is standard Markdown behavior. Why would I want to change it? This is what I want lists to do.

mn4367 commented 10 years ago

Do you have a use case for this? I thought quite a bit about this, but I was unable to find somehting I could only achieve with this behavior.

fletcher commented 10 years ago

Perhaps we aren't understanding each other. I'll re-explain.

Wrapping list items in <p> tags is standard Markdown behavior when the list items are separated by blank lines. John Gruber had this in the original Markdown.pl, and everyone since then does the same thing (aside from bugs that cause an error when handling it.) Please read the Markdown syntax guide if you aren't familiar with it.

I didn't create it. But I do find it handy. I have no intention of changing it.

You're welcome to bring it up with Gruber, but since he hasn't touched Markdown.pl in pushing 10 years, I suspect that won't get you very far.

Given all this, am I misunderstanding your question?

mn4367 commented 10 years ago

Thanks, no you didn't misunderstand my question.