Fix #8745: i18n: KeyError if a new auto footnote_ref in translations

Some writers will be crashed by KeyError because of lack of the refid if
a new auto footnote reference is added to the message catalog by
translation misses.

This detects the invalid footnote references and removes them on
the translation phase.
This commit is contained in:
Takeshi KOMIYA
2021-01-25 00:30:50 +09:00
parent 51d500833e
commit 81ba9273ca
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -78,6 +78,8 @@ Bugs fixed
* #8629: html: A type warning for html_use_opensearch is shown twice
* #8714: html: kbd role with "Caps Lock" rendered incorrectly
* #8665: html theme: Could not override globaltoc_maxdepth in theme.conf
* #8745: i18n: crashes with KeyError when translation message adds a new auto
footnote reference
* #4304: linkcheck: Fix race condition that could lead to checking the
availability of the same URL twice
* #8094: texinfo: image files on the different directory with document are not
+1
View File
@@ -311,6 +311,7 @@ class Locale(SphinxTransform):
refname = newf.get('refname')
refs = old_foot_namerefs.get(refname, [])
if not refs:
newf.parent.remove(newf)
continue
oldf = refs.pop(0)