waylan/Python-Markdown — Issue #76: HTML comment + extra extension throws an AttributeError
Author: skurfer
Created: 2012-01-26 16:18:28+00:00
State: open

To reproduce, put this in a test file and run `markdown_py -x extra test.mdown`:

## Heading ##

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Here's the stack trace:

Traceback (most recent call last):
File "/usr/local/bin/markdown_py", line 34, in
run()
File "/Library/Python/2.7/site-packages/markdown/__main__.py", line 81, in run
markdown.markdownFromFile(**options)
File "/Library/Python/2.7/site-packages/markdown/__init__.py", line 426, in markdownFromFile
kwargs.get('encoding', None))
File "/Library/Python/2.7/site-packages/markdown/__init__.py", line 351, in convertFile
html = self.convert(text)
File "/Library/Python/2.7/site-packages/markdown/__init__.py", line 280, in convert
self.lines = prep.run(self.lines)
File "/Library/Python/2.7/site-packages/markdown/preprocessors.py", line 175, in run
if self.markdown_in_raw and 'markdown' in attrs.keys():
AttributeError: 'tuple' object has no attribute 'keys'

The location of the comment within the file doesn't seem to make a difference. The file is handled fine without the extra extension.