ticket id
000044
status
open
priority
???
assigned to
NOBODY
Reported by: Joshua Inkenbrandt
Component:

I'm assuming their is a bug in the HTMLBlockPreprocessor that messes up the tabbing of the content in a pre or code block. If you have an empty line, then the following line loses its tabs/spaces.

Here's an example:

>>> import markdown
>>>
>>> code = """  
... <pre>
... class Test:
...     hello = "world"
... 
...     def greet(self, name): #WILL FAIL
...         print name
... </pre>
... """
>>>
>>> md = markdown.markdown(code)
>>>
>>> print md
<pre>
class Test:
    hello = "world"

def greet(self, name): #FAILED
        print name
</pre>
>>>

As you can see, it will remove the tab from the beginning of def greet. I haven't had a chance to dive into the code, but I can only assume it has something to do with how it's splitting the lines. Let me know if you need any further examples.

Powered by Sputnik | XHTML 1.1