mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3885: duplicated footnotes raises IndexError
This commit is contained in:
parent
adc056200c
commit
5123dad0fe
1
CHANGES
1
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
|
||||
--------
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user