Commits

Georg Brandl committed f81c863

#495: Fix internal vs. external link distinction for links coming from a docutils table-of-contents.

A node with a refid (i.e. '#anchor' target) can never be external.

  • Participants
  • Parent commits a738c7a

Comments (0)

Files changed (2)

 Release 1.0.3 (in development)
 ==============================
 
+* #495: Fix internal vs. external link distinction for links coming
+  from a docutils table-of-contents.
+
 * #494: Fix the ``maxdepth`` option for the ``toctree()`` template
   callable when used with ``collapse=True``.
 

File sphinx/writers/html.py

     # overwritten
     def visit_reference(self, node):
         atts = {'class': 'reference'}
-        if node.get('internal'):
+        if node.get('internal') or 'refuri' not in node:
             atts['class'] += ' internal'
         else:
             atts['class'] += ' external'