Commits

Georg Brandl committed 52124c3

Fix #613: Allow Unicode characters in production list token names.

  • Participants
  • Parent commits ff10d8f

Comments (0)

Files changed (3)

 Release 1.0.8 (Sep 22, 2011)
 ============================
 
+* #613: Allow Unicode characters in production list token names.
+
 * #720: Add dummy visitors for graphviz nodes for text and man.
 
 * #704: Fix image file duplication bug.

sphinx/domains/std.py

         return [node]
 
 
-token_re = re.compile('`([a-z_][a-z0-9_]*)`')
+token_re = re.compile('`(\w+)`', re.U)
 
 def token_xrefs(text):
     retnodes = []

sphinx/writers/latex.py

         return '\\autopageref*{%s}' % self.idescape(id)
 
     def idescape(self, id):
-        return str(unicode(id).translate(tex_replace_map))
+        return unicode(id).translate(tex_replace_map).\
+            encode('ascii', 'backslashreplace').replace('\\', '_')
 
     def generate_indices(self):
         def generate(content, collapsed):