1. Georg Brandl
  2. sphinx

Commits

Takayuki Shimizukawa  committed 72dceb3

Fix: Citation target missing cause AssertionError. Closes #1160

  • Participants
  • Parent commits 518e76e
  • Branches default

Comments (0)

Files changed (6)

File CHANGES

View file
 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.

File sphinx/environment.py

View file
                             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(

File tests/root/footnote.txt

View file
 .. rubric:: Citations
 
 .. [bar] cite
+
+
+missing target
+--------------------
+[missing]_ citation
+

File tests/test_build_html.py

View file
 
 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; '

File tests/test_build_latex.py

View file
 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; '

File tests/test_build_texinfo.py

View file
 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.\\*'
 """