From: Kjell M. F. <kj...@gm...> - 2008-08-21 19:58:53
|
Dear Python-markdown developers, I have been playing with the development version of Markdown recently and I love it. There are, however, a few bugs in the mainline version: 1. Converting an empty string raises an exception: >>> import markdown >>> markdown.markdown('') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "d:\python25\lib\site-packages\markdown-2.0_alpha2-py2.5.egg\markdown.py" , line 2059, in markdown return md.convert(text) File "d:\python25\lib\site-packages\markdown-2.0_alpha2-py2.5.egg\markdown.py" , line 1939, in convert root = self.applyInlinePatterns(tree).getroot() File "d:\python25\lib\site-packages\markdown-2.0_alpha2-py2.5.egg\markdown.py" , line 1843, in applyInlinePatterns el = markdownTree.getroot() AttributeError: 'unicode' object has no attribute 'getroot' A workaround is to call markdown like this: markdown.markdown(inputdata or " ") to ensure that an empty string is not used. 2. The codehilite extension is broken. The code snippets are inserted at the start of the document. This bug is triggered by markdown's test suite, so you are probably aware of this one (the codehilite test was uncommented in the main test file). 3. When converting a code block a newline and several spaces are inserted between the <pre> and <code> tag: In [6]: text = """This is a normal paragraph: ...: ...: This is a code block. ...: """ In [7]: markdown.markdown(text) Out[7]: u'<p>This is a normal paragraph:</p>\n<pre>\n <code>This is a code bloc k.\n</code>\n</pre>' The extra spaces give visual results in the output. According to the Markdown syntax spec. the correct markup should be: <p>This is a normal paragraph:</p> <pre><code>This is a code block. </code></pre> Thank you for the work you have put into Python Markdown! I will submit some tickets with bug reports tomorrow if you prefer that. Regards, Kjell Magne Fauske |