aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik van Zijst <erik.van.zijst@gmail.com>2012-08-14 16:16:24 -0700
committerErik van Zijst <erik.van.zijst@gmail.com>2012-08-14 16:16:24 -0700
commitdbd6676ca554fb12aa82510a67f5e89ec6ada91c (patch)
tree39ed7ab38ccada7dc6a75a449e89d4da4a697b95
parent2789026a0114dba2e8d60be71b4d7c8cc6eb61ed (diff)
downloadmarkdown-dbd6676ca554fb12aa82510a67f5e89ec6ada91c.tar.gz
markdown-dbd6676ca554fb12aa82510a67f5e89ec6ada91c.tar.bz2
markdown-dbd6676ca554fb12aa82510a67f5e89ec6ada91c.zip
Fixed unicode breakage.
slugify() requires unicode, not a str instance. This causes the extension to crash: File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/__init__.py" in markdown 386. return md.convert(text) File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/__init__.py" in convert 287. newRoot = treeprocessor.run(root) File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/extensions/headerid.py" in run 140. id = slugify(''.join(itertext(elem)), sep) File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/extensions/headerid.py" in slugify 93. value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore') TypeError: must be unicode, not str
-rw-r--r--markdown/extensions/headerid.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/extensions/headerid.py b/markdown/extensions/headerid.py
index 3f9e4c4..e86ab15 100644
--- a/markdown/extensions/headerid.py
+++ b/markdown/extensions/headerid.py
@@ -137,7 +137,7 @@ class HeaderIdTreeprocessor(markdown.treeprocessors.Treeprocessor):
if "id" in elem.attrib:
id = elem.id
else:
- id = slugify(''.join(itertext(elem)), sep)
+ id = slugify(u''.join(itertext(elem)), sep)
elem.set('id', unique(id, self.IDs))
if start_level:
level = int(elem.tag[-1]) + start_level