I’m using python markdown 2.1.1. When I try to markdown a list, why is there a carriage return before
in the list? e.g.,
text = u" - this is a paragraph\r\n\r\n - this is a line\r\n"
markdown.markdown(text)
# produces: u'<ul>\n<li>\n<p>this is a paragraph</p>\n</li>\n<li>\n<p>this is a line</p>\n</li>\n</ul>'
According to the Markdown Syntax, the expected output should be
u'<ul>\n<li><p>this is a paragraph</p></li>\n<li>\n<p>this is a line</p>\n</li>\n</ul>'
No \n before and after the <p> element, right?
This makes the page really ugly because I’m styling the block using white-space: pre-line, so the output would look like
-
this is a paragraph
- this is a line
Markdown does not obey the syntax completely. Use markdown2, which normally behaves better.
Note, you need to write two
'\n'before the first```to enable the regexp matching of fenced-code-blocks.