1 from typing import Any, BinaryIO, Callable, ClassVar, Mapping, Sequence, Text, TextIO
2 from typing_extensions import Literal
3 from xml.etree.ElementTree import Element
5 from .blockparser import BlockParser
6 from .extensions import Extension
7 from .util import HtmlStash, Registry
10 preprocessors: Registry
11 inlinePatterns: Registry
12 treeprocessors: Registry
13 postprocessors: Registry
16 output_formats: ClassVar[dict[Literal["xhtml", "html"], Callable[[Element], Text]]]
17 output_format: Literal["xhtml", "html"]
18 serializer: Callable[[Element], Text]
20 block_level_elements: list[str]
24 extensions: Sequence[str | Extension] | None = ...,
25 extension_configs: Mapping[str, Mapping[str, Any]] | None = ...,
26 output_format: Literal["xhtml", "html"] | None = ...,
27 tab_length: int | None = ...,
29 def build_parser(self) -> Markdown: ...
30 def registerExtensions(self, extensions: Sequence[Extension | str], configs: Mapping[str, Mapping[str, Any]]) -> Markdown: ...
31 def build_extension(self, ext_name: Text, configs: Mapping[str, str]) -> Extension: ...
32 def registerExtension(self, extension: Extension) -> Markdown: ...
33 def reset(self: Markdown) -> Markdown: ...
34 def set_output_format(self, format: Literal["xhtml", "html"]) -> Markdown: ...
35 def is_block_level(self, tag: str) -> bool: ...
36 def convert(self, source: Text) -> Text: ...
39 input: str | TextIO | BinaryIO | None = ...,
40 output: str | TextIO | BinaryIO | None = ...,
41 encoding: str | None = ...,
47 extensions: Sequence[str | Extension] | None = ...,
48 extension_configs: Mapping[str, Mapping[str, Any]] | None = ...,
49 output_format: Literal["xhtml", "html"] | None = ...,
50 tab_length: int | None = ...,
54 input: str | TextIO | BinaryIO | None = ...,
55 output: str | TextIO | BinaryIO | None = ...,
56 encoding: str | None = ...,
57 extensions: Sequence[str | Extension] | None = ...,
58 extension_configs: Mapping[str, Mapping[str, Any]] | None = ...,
59 output_format: Literal["xhtml", "html"] | None = ...,
60 tab_length: int | None = ...,