βΉβΊ
markdown.extensions.md_in_html
ΒΆ
Parse Markdown syntax within raw HTML. Based on the implementation in PHP Markdown Extra.
See the documentation for details.
Classes:
-
HTMLExtractorExtraβOverride
HTMLExtractorand createetreeElementsfor any elements which should have content parsed as -
HtmlBlockPreprocessorβRemove html blocks from the text and store them for later retrieval.
-
MarkdownInHtmlProcessorβProcess Markdown Inside HTML Blocks which have been stored in the
HtmlStash. -
MarkdownInHTMLPostprocessorβ -
MarkdownInHtmlExtensionβAdd Markdown parsing in HTML to Markdown class.
βΉβΊ
markdown.extensions.md_in_html.HTMLExtractorExtra(md: Markdown, *args, **kwargs)
ΒΆ
Bases: HTMLExtractor
Override HTMLExtractor and create etree Elements for any elements which should have content parsed as
Markdown.
Methods:
-
resetβReset this instance. Loses all unprocessed data.
-
closeβHandle any buffered data.
-
get_elementβReturn element from
treebuilderand resettreebuilderfor later use. -
get_stateβReturn state from tag and
markdownattribute. One of βblockβ, βspanβ, or βoffβ.
βΉβΊ
markdown.extensions.md_in_html.MarkdownInHtmlProcessor(parser: BlockParser)
ΒΆ
Bases: BlockProcessor
Process Markdown Inside HTML Blocks which have been stored in the HtmlStash.
Methods:
-
parse_element_contentβRecursively parse the text content of an
etreeElement as Markdown.
βΉβΊ
markdown.extensions.md_in_html.MarkdownInHtmlProcessor.parse_element_content(element: etree.Element) -> None
ΒΆ
Recursively parse the text content of an etree Element as Markdown.
Any block level elements generated from the Markdown will be inserted as children of the element in place
of the text content. All markdown attributes are removed. For any elements in which Markdown parsing has
been disabled, the text content of it and its children are wrapped in an AtomicString.
βΉβΊ
markdown.extensions.md_in_html.MarkdownInHTMLPostprocessor(md: Markdown | None = None)
ΒΆ
Bases: RawHtmlPostprocessor
Methods:
-
stash_to_stringβOverride default to handle any
etreeelements still in the stash.
βΉβΊ
markdown.extensions.md_in_html.MarkdownInHtmlExtension(**kwargs)
ΒΆ
Bases: Extension
Add Markdown parsing in HTML to Markdown class.
Methods:
-
extendMarkdownβRegister extension instances.

