Closed s9w closed 10 years ago
AFAIK that's just how Markdown behaves. I just tried it in two different (non-Pelican) Markdown libraries.
strapdown.js can handle it.
Hmm, after looking into it, this behavior is decribed in this document, which describes the differences between Python-Markdown and other Markdown implementations.
The syntax rules clearly state that when a list item consists of multiple paragraphs, “each subsequent paragraph in a list item must be indented by either 4 spaces or one tab” (emphasis added). However, many implementations do not enforce this rule and allow less than 4 spaces of indentation. The implementers of Python-Markdown consider it a bug to not enforce this rule.
So the four spaces that you're using to indent your code are instead interpreted as a paragraph of the list item. Python-Markdown is following the spec, so I don't expect you'll be able to get this changed.
My suggestion would be to succumb to Markdown and put some text between the list and the code, but if you really don't want to, you can get away with this hack:
- list item
:::python
a=42
Either way, this isn't a Pelican issue, so this can be closed. :)
Very well explained, @mwcz. Many thanks for the assistance!
Works like a charm in pursuance of Makrdown specification. All you need its a place eight spaces before code block. Best regards!
@swasher good job! thank you !
If a code block directly comes after a list, it doesn't seem to work:
it does however if there's some normal text seperating them like this: