Fix #3002: i18n: multiple footnote_references referring same footnote causes duplicated node_ids

This commit is contained in:
Takeshi KOMIYA
2018-11-01 00:54:25 +09:00
parent f4d7b2e60e
commit e3574a6f78
5 changed files with 21 additions and 12 deletions
+7 -3
View File
@@ -794,9 +794,13 @@ def test_xml_footnotes(app, warning):
assert_elem(
para0[0],
['I18N WITH FOOTNOTE', 'INCLUDE THIS CONTENTS',
'2', '[ref]', '1', '100', '*', '.'],
'2', '[ref]', '1', '100', '*', '. SECOND FOOTNOTE_REF', '100', '.'],
['i18n-with-footnote', 'ref'])
# check node_id for footnote_references which refer same footnote (refs: #3002)
assert para0[0][4].text == para0[0][6].text == '100'
assert para0[0][4].attrib['ids'] != para0[0][6].attrib['ids']
footnote0 = secs[0].findall('footnote')
assert_elem(
footnote0[0],
@@ -848,8 +852,8 @@ def test_xml_footnote_backlinks(app):
footnote0 = secs[0].findall('footnote')
for footnote in footnote0:
ids = footnote.attrib.get('ids')
backrefs = footnote.attrib.get('backrefs')
assert refid2id[ids] == backrefs
backrefs = footnote.attrib.get('backrefs').split()
assert refid2id[ids] in backrefs
@sphinx_intl