Merge pull request #4144 from sphinx-doc/fix/referenced_todo

fix #4063: Sphinx crushes when there are referenced todolist
This commit is contained in:
Takeshi KOMIYA 2017-10-18 21:32:44 +09:00 committed by GitHub
commit b2871605cc
2 changed files with 8 additions and 4 deletions

View File

@ -30,6 +30,7 @@ Bugs fixed
* #4108: Search word highlighting breaks SVG images
* #3692: Unable to build HTML if writing .buildinfo failed
* #4152: HTML writer crashes if a field list is placed on top of the document
* #4063: Sphinx crashes when labelling directive '.. todolist::'
Testing
--------

View File

@ -137,11 +137,14 @@ def process_todo_nodes(app, doctree, fromdocname):
env.todo_all_todos = [] # type: ignore
for node in doctree.traverse(todolist):
if not app.config['todo_include_todos']:
node.replace_self([])
continue
if node.get('ids'):
content = [nodes.target()]
else:
content = []
content = []
if not app.config['todo_include_todos']:
node.replace_self(content)
continue
for todo_info in env.todo_all_todos: # type: ignore
para = nodes.paragraph(classes=['todo-source'])