From cd1c7e01dcf49b115be825b86f742f2a10ec152a Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Thu, 12 Oct 2017 23:16:50 +0900 Subject: [PATCH] fix #4063: Sphinx crushes when there are referenced todolist --- CHANGES | 1 + sphinx/ext/todo.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 3e382ef5d..1966e1f07 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ Bugs fixed * #4070, #4111: crashes when the warning message contains format strings (again) * #4108: Search word highlighting breaks SVG images * #3692: Unable to build HTML if writing .buildinfo failed +* #4063: Sphinx crashes when labelling directive '.. todolist::' Testing -------- diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py index 24e9beec1..70974d8c8 100644 --- a/sphinx/ext/todo.py +++ b/sphinx/ext/todo.py @@ -138,10 +138,10 @@ def process_todo_nodes(app, doctree, fromdocname): for node in doctree.traverse(todolist): if not app.config['todo_include_todos']: - node.replace_self([]) + node.replace_self([nodes.target()]) continue - content = [] + content = [nodes.target()] for todo_info in env.todo_all_todos: # type: ignore para = nodes.paragraph(classes=['todo-source'])