Skip to content

Commit

Permalink
Revert a few
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Nov 1, 2023
1 parent 39935ed commit fb2a74a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion markdown/extensions/admonition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions markdown/extensions/codehilite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion markdown/extensions/fenced_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions markdown/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit fb2a74a

Please sign in to comment.