Omit nodes without refuri attribute from toc.ncx.

This fixes bug report on sphinx-dev.
This commit is contained in:
Roland Meister 2010-06-30 21:32:18 +02:00
parent 603f7e5ec8
commit b2a237b8b4

View File

@ -198,7 +198,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
"""Collect section titles, their depth in the toc and the refuri."""
# XXX: is there a better way than checking the attribute
# toctree-l[1-8] on the parent node?
if isinstance(doctree, nodes.reference):
if isinstance(doctree, nodes.reference) and hasattr(doctree, 'refuri'):
refuri = doctree['refuri']
if refuri.startswith('http://') or refuri.startswith('https://') \
or refuri.startswith('irc:') or refuri.startswith('mailto:'):