Fix #3885: duplicated footnotes raises IndexError

This commit is contained in:
Takeshi KOMIYA 2017-06-24 11:23:57 +09:00
parent adc056200c
commit 5123dad0fe
2 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,7 @@ Bugs fixed
* latex: fix ``\sphinxbfcode`` swallows initial space of argument
* #3881: LaTeX figure floated to next page sometimes leaves extra vertical
whitespace
* #3885: duplicated footnotes raises IndexError
Testing
--------

View File

@ -289,7 +289,10 @@ class UnreferencedFootnotesDetector(SphinxTransform):
def apply(self):
for node in self.document.footnotes:
if node['names'][0] not in self.document.footnote_refs:
if node['names'] == []:
# footnote having duplicated number. It is already warned at parser.
pass
elif node['names'][0] not in self.document.footnote_refs:
logger.warning('Footnote [%s] is not referenced.', node['names'][0],
type='ref', subtype='footnote',
location=node)