diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-24 18:22:42 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-24 18:30:50 +0300 |
commit | 81ba9273cabc4a7c2a420b0aac94c18935e6a583 (patch) | |
tree | 4164e93d522f4bd9cf67a97c23109713c271fbfd /sphinx/transforms | |
parent | 51d500833e391c182f536e83a5d62d5e90ce8ca9 (diff) |
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.
Diffstat (limited to 'sphinx/transforms')
-rw-r--r-- | sphinx/transforms/i18n.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 8520cfc69..d588f0411 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -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) |