def convert(self, text): mtext = Markdown.convert(self, text) text = self.postpostprocess(mtext) # This is a total gross hack: reproduce the UnicodeWithAttrs wrapping # that markdown2.py is doing. rv = UnicodeWithAttrs(text) if hasattr(mtext, "_toc"): rv._toc = mtext._toc if hasattr(mtext, "metadata"): rv.metadata = mtext.metadata return rv
def __init__(self, api_sections=None, **kwargs): self.api_sections = api_sections Markdown.__init__(self, **kwargs)