Closed erikbgithub closed 10 years ago
How I got there:
>>> from sphinx.util.texescape import tex_escape_map
>>> ''.translate(tex_escape_map)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: expected a character buffer object
>>> 'a'.translate(tex_escape_map)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: expected a character buffer object
>>> 'abcdef'.translate(tex_escape_map)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: expected a character buffer object
>>>
>>>
>>>
>>> u''.translate(tex_escape_map)
u''
>>> u'abcd'.translate(tex_escape_map)
u'abcd'
>>> unicode('').translate(tex_escape_map)
u''
The idea for unicode()
came up when I saw that tex_escape_map
contained values much bigger then 256.
thanks!
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