#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.
This commit is contained in:
Georg Brandl
2010-08-23 16:04:28 +00:00
parent 6ef0e9ea67
commit e9c9fc9b7f
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
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``.

View File

@@ -159,7 +159,7 @@ class HTMLTranslator(BaseTranslator):
# 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'