Georg Brandl avatar Georg Brandl committed 52124c3

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

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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.