Commits

Takeshi Komiya committed a4eb87b

Fix failure when Targetable nodes without refid attr ware found

Comments (0)

Files changed (2)

actdiag/sphinxcontrib/actdiag.py

     for docname in self.builder.env.found_docs:
         doctree = self.builder.env.get_doctree(docname)
         for target in doctree.traverse(nodes.Targetable):
-            if target.attributes['refid'] == refid:
+            if target.attributes.get('refid') == refid:
                 targetfile = self.builder.get_relative_uri(fromdocname, docname)
                 return targetfile + "#" + refid
 

blockdiag/sphinxcontrib/blockdiag.py

     for docname in self.builder.env.found_docs:
         doctree = self.builder.env.get_doctree(docname)
         for target in doctree.traverse(nodes.Targetable):
-            if target.attributes['refid'] == refid:
+            if target.attributes.get('refid') == refid:
                 targetfile = self.builder.get_relative_uri(fromdocname, docname)
                 return targetfile + "#" + refid