mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
remove unusable 'SEVERE: Duplicate ID' message for footnote that the translation node has been recognized as a duplicate.
This commit is contained in:
parent
c1c0a03895
commit
d6f31f3fa1
@ -262,6 +262,8 @@ class Locale(Transform):
|
||||
'translated message', node)
|
||||
for old, new in zip(old_foot_refs, new_foot_refs):
|
||||
new['ids'] = old['ids']
|
||||
for id in new['ids']:
|
||||
self.document.ids[id] = new
|
||||
self.document.autofootnote_refs.remove(old)
|
||||
self.document.note_autofootnote_ref(new)
|
||||
|
||||
|
@ -114,9 +114,10 @@ def test_i18n_footnote_break_refid(app):
|
||||
# expect no error by build
|
||||
|
||||
|
||||
@with_intl_app(buildername='text', cleanenv=True)
|
||||
@with_intl_app(buildername='text', warning=warnfile)
|
||||
def test_i18n_footnote_regression(app):
|
||||
"""regression test for fix #955"""
|
||||
app.builddir.rmtree(True)
|
||||
app.builder.build(['footnote'])
|
||||
result = (app.outdir / 'footnote.txt').text(encoding='utf-8')
|
||||
expect = (u"\nI18N WITH FOOTNOTE"
|
||||
@ -127,6 +128,10 @@ def test_i18n_footnote_regression(app):
|
||||
u"\n[100] THIS IS A NUMBERED FOOTNOTE.\n")
|
||||
assert result == expect
|
||||
|
||||
warnings = warnfile.getvalue().replace(os.sep, '/')
|
||||
warning_expr = u'.*/footnote.txt:\\d*: SEVERE: Duplicate ID: ".*".\n'
|
||||
assert not re.search(warning_expr, warnings)
|
||||
|
||||
|
||||
@with_intl_app(buildername='html', cleanenv=True)
|
||||
def test_i18n_footnote_backlink(app):
|
||||
|
Loading…
Reference in New Issue
Block a user