-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd behaviour for multiple consecutive lists #142
Comments
Yeah, this is a known issue. We still haven't come to an agreement if we should stick to the original behaviour or not. Personally I think this should be seen as a bug, as it doesn't really make sense. (same goes for adding paragraphs in lists) |
related to #41 |
I completely understand that making changes to markdown behaviour when the library is following the original implementation is a tricky decision. I don't suggest going against the original lightly :) In this particular case, I think the current output is very clearly unexpected behaviour and therefore the original behaviour can be classified as incorrect / a bug. Also as I mentioned, I think the particularly odd nature of this means it's very very unlikely anyone is relying on this behaviour. I'd also add that using babelmark to test snippets often comes up with quite a wide range of different implementations and in this particular case it's very clear that the majority of parsers have opted to classify the original behaviour as incorrect. Therefore I think it is pretty safe to follow suit, lest showdown become the only library still following the old way. Nonetheless, I fully respect that this is not an easy decision to make. Some parsers have a normal version, and a 'strict' version for this sort of thing, but I do believe that's overkill in this particular case. |
@ErisDS I like your idea of |
So, I've tried to reach John Gruber by email to ask what it's opinion on this particular issue but he didn't answer (go figures =P). So I say we fix this in the next release. @pdeschen @SyntaxRules what's your take on this? |
@ErisDS The commit 0bdd02b partially fixes the issue. Now * item 1
* item 2
1. item 1
2. item 2 is parsed into <ul>
<li>Item 1</li>
<li><p>Item 2</p></li>
</ul>
<ol>
<li><p>Item 1</p></li>
<li>Item 2</li>
</ol> I couldn't pinpoint the origin of the issue with the extra paragraphs, I will have a look as soon as possible |
7720c88 now totally fixes this issue. * item 1
* item 2
1. item 1
2. item 2 gets parsed into <ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol> |
Showdown will convert a bulleted list, followed by an ordered list, into one big ordered list with paragraphs in certain items. I believe that this is not really what most people would expect the output to be.
According to Babelmark this behaviour comes from the original Markdown.pl library, however the majority of markdown libraries tested by Babelmark have changed the behaviour to output the two lists as a bulleted list followed by an ordered list.
You can also see in Babelmark that the same is true for the inverse - the majority of markdown libraries have changed away from the original behaviour.
I realise changing this would be backwards incompatible, but I believe it's unlikely many people rely on the existing behaviour - therefore I'd like to propose the behaviour be changed to match the behaviour that Babelmark shows:
That is
Converts to this in showdown currently:
I propose it ought to output:
The text was updated successfully, but these errors were encountered: