KeyError when having a duplicate citation

This commit is contained in:
xavier dupré 2016-12-10 16:02:47 +01:00 committed by Takeshi KOMIYA
parent 048a35ee54
commit d0569a4ec9

View File

@ -540,7 +540,7 @@ class StandardDomain(Domain):
for node in document.traverse(nodes.citation):
label = node[0].astext()
if label in self.data['citations']:
path = env.doc2path(self.data['citations'][0])
path = env.doc2path(self.data['citations'][label][0])
env.warn_node('duplicate citation %s, other instance in %s' %
(label, path), node)
self.data['citations'][label] = (docname, node['ids'][0])