-
Notifications
You must be signed in to change notification settings - Fork 870
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
ordered/unordered list problem #64
Comments
As difficult as it may seem, stackoverflow has it wrong. Python-Markdown's goal is to emulate markdown.pl (the original) as closely as possible. So while markdown.pl's behavior in this case is hard to wrap your head around, we will continue to support that behavior. Stackoverflow on the other hand, is more interested in generating output that does not surprise its users - people who may not be familiar with the intricacies of markdown syntax. Of course, our Extension API makes it relativity easy for someone to alter the default behavior however they would like. No bug hear so I'm closing this. |
Sorry, Waylan, but it is not acceptable to say "this is a convoluted, ridiculously hard-to-understand 'feature' of markdown". If the result is totally non-intuitive to the user it is totally non-Markdown. Period. If I type 1. ordered 2. list * unordered * list and I get 1. ordered 2. list 3. unordered 4. list that is not acceptable on any level. |
On Sat, Jan 7, 2012 at 10:54 PM, NevarMaor wrote:
I understand your frustration. However, I didn't write the syntax As I see it, the Python-Markdown project has two primary goals:
Give the number of people who dislike the behavior in question, I Why haven't I written such an extension myself? For one, I maintain I didn't like the current behavior at first either. However, search \X/ /-\ `/ |_ /-\ || |
I sympathize with both parties but felt compelled to draw attention to the straw man above. Yes, there are thousands upon thousands of Markdown documents in existence. Yes, each of these documents was written at a time when Markdown.pl included this bug. But it's a stretch to suggest that a significant number of these documents rely on this nonsensical behaviour. Closing the issue because “that's what Markdown.pl does” is fine, but backwards compatibility isn't a concern here in practice. |
I can't see anyone typing lists to consciously take advantage of this "feature". It is entirely counterintuitive and, as I stated earlier, opposed to Markdown's stated philosophy of producing what you expect. However, Markdown is apparently locked beyond repair to an abandoned, frankly half-finished, specification - kind of like latin. Unfortunate, because overall I do find it the most comfortable lightweight markup to work with. |
I agree with @davidchambers. The business about existing documents tells us that there are a lot of users that have been tolerating this behavior. It doesn’t say anything about the number of users depending on it. For that, we can only guess. My guess is 0. ;-) |
So a lot of people want this feature and as I said previously, I'm not opposed to an extension. I just started throwing an extension together and in 15-20 minutes have a working extension - well almost. The original example provided above by yegle works. But what about this example (no blank line):
Also, any ideas for a good name for the extension? I'm currently using "sane_lists" but am open to suggestions. Oh, and making this new behavior the default is not an option. Any such requests will be ignored. |
The effort is appreciated. For the example with no blank line, I would treat it much the same way this would be treated
That is, completely fall apart and force the author to think about what they did wrong. :-) As for the name, I can’t think of anything better. Here are some that are worse: adjacent_lists, list_mixing |
This will make it easier for extensions to subclass the list block processors and alter their behavior. Such as the request in issue #64.
For some reason github isn't linking to my commit from this issue. The extension was added in commit a9cd895. |
This is an extension which alters the behavior of lists to be less surprising. If turned out to be rather simple to code. I'm surprised no one had written it yet. I should note that this extension does not generate separate lists if different unordered list markers are used (`*` verses `-` verses `+`) The way the parser works that would be a little more tricky.
sample code:
Tried python-markdown and http://daringfireball.net/projects/markdown/dingus, the actual output is a long ordered list with extra
tags
But on stackoverflow's online markdown editor ( http://stackoverflow.com/questions/ask ), the output is OK ( a ordered list and an unordered list )
The text was updated successfully, but these errors were encountered: