diff --git a/CHANGES b/CHANGES index 01a4d3ce2..3c51d6286 100644 --- a/CHANGES +++ b/CHANGES @@ -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 -------- diff --git a/sphinx/transforms/__init__.py b/sphinx/transforms/__init__.py index 0a7db678f..57bdb1059 100644 --- a/sphinx/transforms/__init__.py +++ b/sphinx/transforms/__init__.py @@ -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)