#253: Ignore graphviz directives without content instead of

raising an unhandled exception.
This commit is contained in:
Georg Brandl 2009-09-03 18:15:55 +02:00
parent 456abdefbe
commit 3cc52246b2
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,9 @@
Release 0.6.3 (in development)
==============================
* #253: Ignore graphviz directives without content instead of
raising an unhandled exception.
* #241: Fix a crash building LaTeX output for documents that contain
a todolist directive.

View File

@ -50,8 +50,13 @@ class Graphviz(Directive):
option_spec = {}
def run(self):
dotcode = '\n'.join(self.content)
if not dotcode.strip():
return [self.state_machine.reporter.warning(
'Ignoring "graphviz" directive without content.',
line=self.lineno)]
node = graphviz()
node['code'] = '\n'.join(self.content)
node['code'] = dotcode
node['options'] = []
return [node]