diff options
author | Georg Brandl <georg@python.org> | 2009-09-03 18:08:57 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-03 18:08:57 +0200 |
commit | 1651423e205f44d0eb68b16a7a189c504f654122 (patch) | |
tree | 2459129262354e8474c8f65ceda6d534620290f2 | |
parent | 0431180c97bf270742cc5d06a24910a35b5e9c3e (diff) | |
download | sphinx-1651423e205f44d0eb68b16a7a189c504f654122.tar.gz |
#241: Fix a crash building LaTeX output for documents that contain
a todolist directive.
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | sphinx/ext/todo.py | 11 |
2 files changed, 11 insertions, 3 deletions
@@ -1,6 +1,9 @@ Release 0.6.3 (in development) ============================== +* #241: Fix a crash building LaTeX output for documents that contain + a todolist directive. + * #252: Make it easier to change the build dir in the Makefiles generated by quickstart. diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py index e2a1bb4a..d726b0eb 100644 --- a/sphinx/ext/todo.py +++ b/sphinx/ext/todo.py @@ -14,6 +14,7 @@ from docutils import nodes +from sphinx.environment import NoUri from sphinx.util.compat import Directive, make_admonition class todo_node(nodes.Admonition, nodes.Element): pass @@ -104,9 +105,13 @@ def process_todo_nodes(app, doctree, fromdocname): newnode = nodes.reference('', '') innernode = nodes.emphasis(_('here'), _('here')) newnode['refdocname'] = todo_info['docname'] - newnode['refuri'] = app.builder.get_relative_uri( - fromdocname, todo_info['docname']) - newnode['refuri'] += '#' + todo_info['target']['refid'] + try: + newnode['refuri'] = app.builder.get_relative_uri( + fromdocname, todo_info['docname']) + newnode['refuri'] += '#' + todo_info['target']['refid'] + except NoUri: + # ignore if no URI can be determined, e.g. for LaTeX output + pass newnode.append(innernode) para += newnode para += nodes.Text('.)', '.)') |