mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#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:
3
CHANGES
3
CHANGES
@@ -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``.
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user