Fix: Citation target missing cause AssertionError. Closes #1160

This commit is contained in:
Takayuki Shimizukawa 2013-05-02 10:37:12 +09:00
parent fea8264aa5
commit 9d3bac3b8e
6 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,7 @@ Features added
Bugs fixed
----------
* #1160: Citation target missing cause AssertionError.
* #1157: Combination of 'globaltoc.html' and hidden toctree cause exception.
* Fix: 'make gettext' cause UnicodeDecodeError when templates contain utf-8
encoded string.

View File

@ -1354,6 +1354,10 @@ class BuildEnvironment:
if not isinstance(contnode, nodes.Element):
del node['ids'][:]
raise
elif 'ids' in node:
# remove ids attribute that annotated at
# transforms.CitationReference.apply.
del node['ids'][:]
# no new node found? try the missing-reference event
if newnode is None:
newnode = builder.app.emit_firstresult(

View File

@ -38,3 +38,9 @@ footenotes
.. rubric:: Citations
.. [bar] cite
missing target
--------------------
[missing]_ citation

View File

@ -49,6 +49,7 @@ http://sphinx-doc.org/domains.html
HTML_WARNINGS = ENV_WARNINGS + """\
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\\*'
None:\\d+: WARNING: citation not found: missing
%(root)s/markup.txt:: WARNING: invalid single index entry u''
%(root)s/markup.txt:: WARNING: invalid pair index entry u''
%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '

View File

@ -28,6 +28,7 @@ def teardown_module():
latex_warnfile = StringIO()
LATEX_WARNINGS = ENV_WARNINGS + """\
None:None: WARNING: citation not found: missing
None:None: WARNING: no matching candidate for image URI u'foo.\\*'
WARNING: invalid pair index entry u''
WARNING: invalid pair index entry u'keyword; '

View File

@ -28,6 +28,7 @@ def teardown_module():
texinfo_warnfile = StringIO()
TEXINFO_WARNINGS = ENV_WARNINGS + """\
None:None: WARNING: citation not found: missing
None:None: WARNING: no matching candidate for image URI u'foo.\\*'
None:None: WARNING: no matching candidate for image URI u'svgimg.\\*'
"""