Permalink
Browse files

ext/latex_mods: Fix TypeError for alt tags

When not using alt tags on figures, latex_mods.py failed with a TypeError. The
problem was, that the strings are not necessarily unicode, but the escape_map
used only works with unicodes.

Fixes #12

Signed-off-by: Erik Bernoth <erik.bernoth@gmail.com>
  • Loading branch information...
1 parent 7047b10 commit f1b790275162ef527093ad9dce444b904e7762f7 @erikbgithub erikbgithub committed Sep 27, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 extensions/latex_mods.py
View
@@ -27,7 +27,7 @@ def visit_caption(self, node):
else:
look_node = node.parent
- short_caption = look_node.get('alt', '').translate(tex_escape_map)
+ short_caption = unicode(look_node.get('alt', '')).translate(tex_escape_map)
if short_caption != "":
short_caption = '[%s]' % short_caption

0 comments on commit f1b7902

Please sign in to comment.