|
1 | 1 | from re import Pattern
|
2 | 2 | from typing import ClassVar
|
| 3 | +from typing_extensions import deprecated |
| 4 | +from xml.etree.ElementTree import Element |
3 | 5 |
|
| 6 | +from markdown.blockparser import BlockParser |
4 | 7 | from markdown.blockprocessors import BlockProcessor
|
| 8 | +from markdown.core import Markdown |
5 | 9 | from markdown.extensions import Extension
|
6 | 10 | from markdown.inlinepatterns import InlineProcessor
|
| 11 | +from markdown.treeprocessors import Treeprocessor |
7 | 12 |
|
8 |
| -class AbbrExtension(Extension): ... |
| 13 | +class AbbrExtension(Extension): |
| 14 | + def reset(self) -> None: ... |
| 15 | + def reset_glossary(self) -> None: ... |
| 16 | + def load_glossary(self, dictionary: dict[str, str]) -> None: ... |
9 | 17 |
|
10 |
| -class AbbrPreprocessor(BlockProcessor): |
| 18 | +class AbbrTreeprocessor(Treeprocessor): |
| 19 | + RE: Pattern[str] | None |
| 20 | + abbrs: dict[str, str] |
| 21 | + def __init__(self, md: Markdown | None = None, abbrs: dict[str, str] | None = None) -> None: ... |
| 22 | + def iter_element(self, el: Element, parent: Element | None = None) -> None: ... |
| 23 | + |
| 24 | +# Techinically it is the same type as `AbbrPreprocessor` just not deprecated. |
| 25 | +class AbbrBlockprocessor(BlockProcessor): |
11 | 26 | RE: ClassVar[Pattern[str]]
|
| 27 | + abbrs: dict[str, str] |
| 28 | + def __init__(self, parser: BlockParser, abbrs: dict[str, str]) -> None: ... |
| 29 | + |
| 30 | +@deprecated("This class will be removed in the future; use `AbbrTreeprocessor` instead.") |
| 31 | +class AbbrPreprocessor(AbbrBlockprocessor): ... |
12 | 32 |
|
| 33 | +@deprecated("This class will be removed in the future; use `AbbrTreeprocessor` instead.") |
13 | 34 | class AbbrInlineProcessor(InlineProcessor):
|
14 | 35 | title: str
|
15 | 36 | def __init__(self, pattern: str, title: str) -> None: ...
|
|
0 commit comments