code: def graphviz_parser(preprocessor, tag, markup):
      
  
      # Parse the markup string
      m = DOT_BLOCK_RE.search(markup)
      if m:
          # Get program and DOT code
          code = m.group('code')
          program = m.group('program').strip()
  
          # Run specified program with our markup
          output = run_graphviz(program, code)
  
          # Return Base64 encoded image
          return '<span class="graphviz" style="text-align: center;"><img src="data:image/png;base64,%s"></span>' % base64.b64encode(output).decode('utf-8')
      else:
          raise ValueError('Error processing input. '
                           'Expected syntax: {0}'.format(SYNTAX))
docs: Simple Graphviz parser