Skip to content

Commit

Permalink
#241: Fix a crash building LaTeX output for documents that contain
Browse files Browse the repository at this point in the history
a todolist directive.
  • Loading branch information
birkenfeld committed Sep 3, 2009
1 parent 3276bb4 commit 456abde
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
11 changes: 8 additions & 3 deletions sphinx/ext/todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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('.)', '.)')
Expand Down

0 comments on commit 456abde

Please sign in to comment.