diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py index 01c2316d..d0e97002 100644 --- a/markdown/extensions/admonition.py +++ b/markdown/extensions/admonition.py @@ -59,7 +59,7 @@ def __init__(self, parser: blockparser.BlockParser): super().__init__(parser) self.current_sibling: etree.Element | None = None - self.content_indent = 0 + self.content_indention = 0 def parse_content(self, parent: etree.Element, block: str) -> tuple[etree.Element | None, str, str]: """Get sibling admonition. diff --git a/markdown/extensions/codehilite.py b/markdown/extensions/codehilite.py index 352f1eaa..0114908f 100644 --- a/markdown/extensions/codehilite.py +++ b/markdown/extensions/codehilite.py @@ -27,7 +27,6 @@ from typing import TYPE_CHECKING, Callable, Any if TYPE_CHECKING: # pragma: no cover - from markdown import Markdown import xml.etree.ElementTree as etree try: # pragma: no cover @@ -255,7 +254,6 @@ class HiliteTreeprocessor(Treeprocessor): """ Highlight source code in code blocks. """ config: dict[str, Any] - md: Markdown def code_unescape(self, text: str) -> str: """Unescape code.""" diff --git a/markdown/extensions/fenced_code.py b/markdown/extensions/fenced_code.py index 40e01018..da1a9be1 100644 --- a/markdown/extensions/fenced_code.py +++ b/markdown/extensions/fenced_code.py @@ -159,7 +159,7 @@ def handle_attrs(self, attrs: Iterable[tuple[str, str]]) -> tuple[str, list[str] """ Return tuple: `(id, [list, of, classes], {configs})` """ id = '' classes = [] - configs: dict[str, Any] = {} + configs = {} for k, v in attrs: if k == 'id': id = v diff --git a/markdown/serializers.py b/markdown/serializers.py index cc48710c..573b2648 100644 --- a/markdown/serializers.py +++ b/markdown/serializers.py @@ -48,7 +48,7 @@ from xml.etree.ElementTree import ProcessingInstruction from xml.etree.ElementTree import Comment, ElementTree, Element, QName, HTML_EMPTY import re -from typing import Callable, Iterable, Literal, NoReturn +from typing import Callable, Literal, NoReturn __all__ = ['to_html_string', 'to_xhtml_string'] @@ -136,7 +136,7 @@ def _serialize_html(write: Callable[[str], None], elem: Element, format: Literal else: raise ValueError('QName objects must define a tag.') write("<" + tag) - items: Iterable[tuple[str, str]] = elem.items() + items = elem.items() if items: items = sorted(items) # lexical order for k, v in items: