Skip to content

Commit

Permalink
Bump Markdown to 3.7.* (#12565)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Rittau <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
  • Loading branch information
4 people authored Aug 21, 2024
1 parent 7f38b11 commit 8307b3c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions stubs/Markdown/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Deprecated types are infered as functions:
markdown.extensions.abbr.AbbrPreprocessor
markdown.extensions.abbr.AbbrInlineProcessor
2 changes: 1 addition & 1 deletion stubs/Markdown/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.6.*"
version = "3.7.*"
upstream_repository = "https://github.com/Python-Markdown/markdown"
partial_stub = true

Expand Down
25 changes: 23 additions & 2 deletions stubs/Markdown/markdown/extensions/abbr.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
from re import Pattern
from typing import ClassVar
from typing_extensions import deprecated
from xml.etree.ElementTree import Element

from markdown.blockparser import BlockParser
from markdown.blockprocessors import BlockProcessor
from markdown.core import Markdown
from markdown.extensions import Extension
from markdown.inlinepatterns import InlineProcessor
from markdown.treeprocessors import Treeprocessor

class AbbrExtension(Extension): ...
class AbbrExtension(Extension):
def reset(self) -> None: ...
def reset_glossary(self) -> None: ...
def load_glossary(self, dictionary: dict[str, str]) -> None: ...

class AbbrPreprocessor(BlockProcessor):
class AbbrTreeprocessor(Treeprocessor):
RE: Pattern[str] | None
abbrs: dict[str, str]
def __init__(self, md: Markdown | None = None, abbrs: dict[str, str] | None = None) -> None: ...
def iter_element(self, el: Element, parent: Element | None = None) -> None: ...

# Techinically it is the same type as `AbbrPreprocessor` just not deprecated.
class AbbrBlockprocessor(BlockProcessor):
RE: ClassVar[Pattern[str]]
abbrs: dict[str, str]
def __init__(self, parser: BlockParser, abbrs: dict[str, str]) -> None: ...

@deprecated("This class will be removed in the future; use `AbbrTreeprocessor` instead.")
class AbbrPreprocessor(AbbrBlockprocessor): ...

@deprecated("This class will be removed in the future; use `AbbrTreeprocessor` instead.")
class AbbrInlineProcessor(InlineProcessor):
title: str
def __init__(self, pattern: str, title: str) -> None: ...
Expand Down

0 comments on commit 8307b3c

Please sign in to comment.