Commits

Georg Brandl  committed 1f2654a

#321: Fix link generation in the LaTeX builder -- target names need to be escaped in references as well as definitions.

  • Participants
  • Parent commits bebf41e

Comments (0)

Files changed (2)

+Release 0.6.5 (in development)
+==============================
+
+* #321: Fix link generation in the LaTeX builder.
+
+
 Release 0.6.4 (Jan 12, 2010)
 ============================
 

File sphinx/writers/latex.py

             self.body.append('\\href{%s}{' % self.encode_uri(uri))
             self.context.append('}')
         elif uri.startswith('#'):
-            self.body.append('\\hyperlink{%s}{' % uri[1:])
+            # references to labels
+            self.body.append('\\hyperlink{%s}{' % self.idescape(uri[1:]))
             self.context.append('}')
         elif uri.startswith('%'):
+            # references to documents or labels inside documents
             hashindex = uri.find('#')
             targetname = (hashindex == -1) and '--doc-' + uri[1:] \
                                            or uri[hashindex+1:]
-            self.body.append('\\hyperlink{%s}{' % targetname)
+            self.body.append('\\hyperlink{%s}{' % self.idescape(targetname))
             self.context.append('}')
         elif uri.startswith('@token'):
             if self.in_production_list: