waylan/Python-Markdown — Issue #47: Freeze with table rendered without Markdown Extra
Author: jpfleury
Created: 2011-10-15 18:37:02+00:00
State: open

1. Create a file `m.py` with the following content:

import markdown

text = """
Lorem ipsum | Lorem ipsum | Lorem ipsum
----------------------------------- | :---------: | :---------:
Lorem ipsum dolor sit amet inceptos | Lorem ipsum | Lorem ipsum
"""

print markdown.markdown(text)

2. Run the file:

$ python m.py

**Actual result:** Python-Markdown freezes. If we interrupt the process, we have the following output:

$ python m.py
^CTraceback (most recent call last):
File "m.py", line 9, in
print markdown.markdown(text)
File "/home/nom/.local/lib/python2.7/site-packages/markdown/__init__.py", line 386, in markdown
return md.convert(text)
File "/home/nom/.local/lib/python2.7/site-packages/markdown/__init__.py", line 283, in convert
root = self.parser.parseDocument(self.lines).getroot()
File "/home/nom/.local/lib/python2.7/site-packages/markdown/blockparser.py", line 62, in parseDocument
self.parseChunk(self.root, '\n'.join(lines))
File "/home/nom/.local/lib/python2.7/site-packages/markdown/blockparser.py", line 77, in parseChunk
self.parseBlocks(parent, text.split('\n\n'))
File "/home/nom/.local/lib/python2.7/site-packages/markdown/blockparser.py", line 93, in parseBlocks
if processor.test(parent, blocks[0]):
File "/home/nom/.local/lib/python2.7/site-packages/markdown/blockprocessors.py", line 470, in test
return bool(self.SEARCH_RE.search(block))
KeyboardInterrupt
$

**Expected result:** no freeze. Both PHP Markdown (no Extra) and Markdown.pl output the following:

<p>Lorem ipsum | Lorem ipsum | Lorem ipsum
----------------------------------- | :---------: | :---------:
Lorem ipsum dolor sit amet inceptos | Lorem ipsum | Lorem ipsum</p>

**More information:**

- The bug doesn't occur with extension Extra:

print markdown.markdown(text, extensions=['extra'])

- Tested with `waylan-Python-Markdown-2.1.0.beta-0-ge8cdb0b.zip`.