From b2a237b8b4e613904965295129621d621cf28ecc Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Wed, 30 Jun 2010 21:32:18 +0200 Subject: [PATCH] Omit nodes without refuri attribute from toc.ncx. This fixes bug report on sphinx-dev. --- sphinx/builders/epub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index 74c328ea7..a5f7a84d0 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -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:'):