1. Luke Plant
  2. sphinx

Commits

Georg Brandl  committed 801f913

#253: Ignore graphviz directives without content instead of
raising an unhandled exception.

  • Participants
  • Parent commits 75aa56e
  • Branches default

Comments (0)

Files changed (2)

File CHANGES

View file
  • Ignore whitespace
 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.
 

File sphinx/ext/graphviz.py

View file
  • Ignore whitespace
     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]