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.
| 76 | |
| 77 | |
| 78 | class 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') |
no outgoing calls
no test coverage detected
searching dependent graphs…