Fix #6718: i18n: KeyError is raised if section title and table title are same

This commit is contained in:
Takeshi KOMIYA 2019-10-13 01:36:05 +09:00
parent 2d609ddf58
commit d0b1083593
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ Bugs fixed
* #6704: linkcheck: Be defensive and handle newly defined HTTP error code
* #6655: image URLs containing ``data:`` causes gettext builder crashed
* #6584: i18n: Error when compiling message catalogs on Hindi
* #6718: i18n: KeyError is raised if section title and table title are same
Testing
--------

View File

@ -134,7 +134,7 @@ class Locale(SphinxTransform):
processed = False # skip flag
# update title(section) target name-id mapping
if isinstance(node, nodes.title):
if isinstance(node, nodes.title) and isinstance(node.parent, nodes.section):
section_node = node.parent
new_name = nodes.fully_normalize_name(patch.astext())
old_name = nodes.fully_normalize_name(node.astext())