diff --git a/stubs/Markdown/METADATA.toml b/stubs/Markdown/METADATA.toml index 082b7e378938..c68111021308 100644 --- a/stubs/Markdown/METADATA.toml +++ b/stubs/Markdown/METADATA.toml @@ -1,2 +1,2 @@ -version = "~=3.11.2" +version = "~=3.11.3" upstream-repository = "https://github.com/Python-Markdown/markdown" diff --git a/stubs/Markdown/markdown/extensions/toc.pyi b/stubs/Markdown/markdown/extensions/toc.pyi index 27fd77b833ff..f7adf9c3f74d 100644 --- a/stubs/Markdown/markdown/extensions/toc.pyi +++ b/stubs/Markdown/markdown/extensions/toc.pyi @@ -1,6 +1,6 @@ from collections.abc import Iterator, MutableSet from re import Pattern -from typing import Any, TypedDict, type_check_only +from typing import Any, Protocol, TypedDict, type_check_only from typing_extensions import deprecated from xml.etree.ElementTree import Element @@ -20,9 +20,14 @@ class _FlatTocToken(TypedDict): class _TocToken(_FlatTocToken): children: list[_TocToken] +@type_check_only +class _IdCounters(Protocol): + def get(self, key: str, default: int, /) -> int: ... + def __setitem__(self, key: str, value: int, /) -> None: ... + def slugify(value: str, separator: str, unicode: bool = False) -> str: ... def slugify_unicode(value: str, separator: str) -> str: ... -def unique(id: str, ids: MutableSet[str]) -> str: ... +def unique(id: str, ids: MutableSet[str], counters: _IdCounters | None = None) -> str: ... @deprecated("Use `render_inner_html` and `striptags` instead.") def get_name(el: Element) -> str: ... @deprecated("Use `run_postprocessors`, `render_inner_html` and/or `striptags` instead.") diff --git a/stubs/Markdown/markdown/inlinepatterns.pyi b/stubs/Markdown/markdown/inlinepatterns.pyi index 7f5ac1711cb1..6c7060030e2b 100644 --- a/stubs/Markdown/markdown/inlinepatterns.pyi +++ b/stubs/Markdown/markdown/inlinepatterns.pyi @@ -111,6 +111,8 @@ class DelimiterProcessor(InlineProcessor): def reset(self) -> None: ... def increment_next_position(self, start: int, count: int) -> None: ... def get_cached_result(self, pos: int, data: str) -> tuple[Element, int, int]: ... + @staticmethod + def rule_of_3(opener: int, closer: int) -> bool: ... def get_match(self, data: str, start: int) -> re.Match[str] | None: ... def search(self, data: str, start: int) -> re.Match[str] | None: ... def add_region(self, delim: Delimiter, a: int, b: int, c: int, d: int, size: int) -> None: ...