Commits

Georg Brandl  committed 9cb18b2

Fix traceback with ``only`` directives preceded by targets.

  • Participants
  • Parent commits 2d9befd

Comments (0)

Files changed (2)

 Release 1.0.7 (in development)
 ==============================
 
+* Fix traceback with ``only`` directives preceded by targets.
+
 * Fix tracebacks occurring for duplicate C++ domain objects.
 
 

File sphinx/environment.py

                 if ret:
                     node.replace_self(node.children)
                 else:
-                    node.replace_self([])
+                    # replacing by [] would result in an "Losing ids" exception
+                    # if there is a target node before the only node
+                    node.replace_self(nodes.comment())
 
         # allow custom references to be resolved
         builder.app.emit('doctree-resolved', doctree, fromdocname)