MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / HtmlBlockPreprocessor

Class HtmlBlockPreprocessor

markdown/preprocessors.py:78–91  ·  view source on GitHub ↗

Remove html blocks from the text and store them for later retrieval. The raw HTML is stored in the [`htmlStash`][markdown.util.HtmlStash] of the [`Markdown`][markdown.Markdown] instance.

Source from the content-addressed store, hash-verified

76
77
78class HtmlBlockPreprocessor(Preprocessor):
79 """
80 Remove html blocks from the text and store them for later retrieval.
81
82 The raw HTML is stored in the [`htmlStash`][markdown.util.HtmlStash] of the
83 [`Markdown`][markdown.Markdown] instance.
84 """
85
86 def run(self, lines: list[str]) -> list[str]:
87 source = '\n'.join(lines)
88 parser = HTMLExtractor(self.md)
89 parser.feed(source)
90 parser.close()
91 return ''.join(parser.cleandoc).split('\n')

Callers 1

build_preprocessorsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…