1. Georg Brandl
  2. sphinx

Commits

Georg Brandl  committed 3e7c5b3

#470: Fix generated target names for reST domain objects; they are not in the same namespace.

  • Participants
  • Parent commits 8bb9c0b
  • Branches default

Comments (0)

Files changed (3)

File CHANGES

View file
  • Ignore whitespace
 Release 1.0.1 (in development)
 ==============================
 
+* #470: Fix generated target names for reST domain objects; they
+  are not in the same namespace.
+
 * #266: Add Bengali language.
 
 * #473: Fix a bug in parsing JavaScript object names.

File sphinx/domains/rst.py

View file
  • Ignore whitespace
 
     def add_target_and_index(self, name, sig, signode):
         if name not in self.state.document.ids:
-            signode['names'].append(name)
-            signode['ids'].append(name)
+            targetname = name + '-' + self.objtype
+            signode['names'].append(targetname)
+            signode['ids'].append(targetname)
             signode['first'] = (not self.names)
             self.state.document.note_explicit_target(signode)
 
         indextext = self.get_index_text(self.objtype, name)
         if indextext:
             self.indexnode['entries'].append(('single', indextext,
-                                              name, name))
+                                              targetname, targetname))
 
     def get_index_text(self, objectname, name):
         if self.objtype == 'directive':

File sphinx/environment.py

View file
  • Ignore whitespace
 
 # This is increased every time an environment attribute is added
 # or changed to properly invalidate pickle files.
-ENV_VERSION = 36
+ENV_VERSION = 37
 
 
 default_substitutions = set([