Resets all state variables to prepare the parser instance for new input. Called once upon creation of a class instance. Should be called manually between calls to [`Markdown.convert`][markdown.Markdown.convert].
(self)
| 263 | return self |
| 264 | |
| 265 | def reset(self) -> Markdown: |
| 266 | """ |
| 267 | Resets all state variables to prepare the parser instance for new input. |
| 268 | |
| 269 | Called once upon creation of a class instance. Should be called manually between calls |
| 270 | to [`Markdown.convert`][markdown.Markdown.convert]. |
| 271 | """ |
| 272 | self.htmlStash.reset() |
| 273 | self.references.clear() |
| 274 | # The source lines and parsed tree of the last document are released |
| 275 | # here rather than in `convert`: both have long been reachable from |
| 276 | # the instance (`md.lines`, `md.parser.root`), and third-party |
| 277 | # extensions may read them until parsing is done. |
| 278 | self.lines = [] |
| 279 | self.parser.root = None |
| 280 | |
| 281 | if self.delimiters is not None: |
| 282 | self.delimiters.reset() |
| 283 | if self.delimiters not in self.inlinePatterns: |
| 284 | self.delimiters = None |
| 285 | |
| 286 | for extension in self.registeredExtensions: |
| 287 | if hasattr(extension, 'reset'): |
| 288 | extension.reset() |
| 289 | |
| 290 | return self |
| 291 | |
| 292 | def set_output_format(self, format: str) -> Markdown: |
| 293 | """ |
no outgoing calls