summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-07-23 23:19:46 +0900
committerGitHub <noreply@github.com>2018-07-23 23:19:46 +0900
commita57b9ccdf7ca889ac52f686a51aa8e4855919f3c (patch)
treedc455198e77f1b43a3185b0a4ec66415a822bbaa
parent250e6dbc6c8c23aecd57d89201660bd68a2f8b89 (diff)
parent1ab2ea7ff0e6de25577e5dc302e7e86e8bc5d0a4 (diff)
downloadsphinx-git-a57b9ccdf7ca889ac52f686a51aa8e4855919f3c.tar.gz
Merge pull request #5210 from tk0miya/4611_self_toctree_for_epub
epub: spine has been broken because of "self" in toctree
-rw-r--r--CHANGES1
-rw-r--r--sphinx/builders/_epub_base.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 429345e12..89aef3572 100644
--- a/CHANGES
+++ b/CHANGES
@@ -175,6 +175,7 @@ Bugs fixed
* #5132: (lualatex) PDF build fails if indexed word starts with Unicode character
* #5133: latex: index headings "Symbols" and "Numbers" not internationalized
* #5114: sphinx-build: Handle errors on scanning documents
+* epub: spine has been broken when "self" is listed on toctree (refs: #4611)
Testing
--------
diff --git a/sphinx/builders/_epub_base.py b/sphinx/builders/_epub_base.py
index 2a975fa94..eaab43fda 100644
--- a/sphinx/builders/_epub_base.py
+++ b/sphinx/builders/_epub_base.py
@@ -195,7 +195,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) and 'refuri' in doctree:
+ if isinstance(doctree, nodes.reference) and doctree.get('refuri'):
refuri = doctree['refuri']
if refuri.startswith('http://') or refuri.startswith('https://') \
or refuri.startswith('irc:') or refuri.startswith('mailto:'):