Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stubs/Markdown/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "3.8.*"
version = "3.9.*"
upstream_repository = "https://github.com/Python-Markdown/markdown"
11 changes: 11 additions & 0 deletions stubs/Markdown/markdown/extensions/footnotes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ from markdown.treeprocessors import Treeprocessor
FN_BACKLINK_TEXT: str
NBSP_PLACEHOLDER: str
RE_REF_ID: Pattern[str]
RE_REFERENCE: Pattern[str]

class FootnoteExtension(Extension):
unique_prefix: int
Expand All @@ -22,11 +23,13 @@ class FootnoteExtension(Extension):
def __init__(self, **kwargs) -> None: ...
parser: BlockParser
md: Markdown
footnote_order: list[str]
footnotes: OrderedDict[str, str]
def reset(self) -> None: ...
def unique_ref(self, reference: str, found: bool = False) -> str: ...
def findFootnotesPlaceholder(self, root: Element) -> tuple[Element, Element, bool] | None: ...
def setFootnote(self, id: str, text: str) -> None: ...
def addFootnoteRef(self, id: str) -> None: ...
def get_separator(self) -> str: ...
def makeFootnoteId(self, id: str) -> str: ...
def makeFootnoteRefId(self, id: str, found: bool = False) -> str: ...
Expand All @@ -49,11 +52,19 @@ class FootnotePostTreeprocessor(Treeprocessor):
def add_duplicates(self, li: Element, duplicates: int) -> None: ...
def get_num_duplicates(self, li: Element) -> int: ...
def handle_duplicates(self, parent: Element) -> None: ...
def run(self, root: Element) -> None: ...
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I opportunistically added a few overrides for run methods: the definition in Treeprocessor has the signature def run(self, root: Element) -> Element | None: ..., but these implemenations always return None.

offset: int

class FootnoteTreeprocessor(Treeprocessor):
footnotes: FootnoteExtension
def __init__(self, footnotes: FootnoteExtension) -> None: ...
def run(self, root: Element) -> None: ...

class FootnoteReorderingProcessor(Treeprocessor):
footnotes: FootnoteExtension
def __init__(self, footnotes: FootnoteExtension) -> None: ...
def run(self, root: Element) -> None: ...
def reorder_footnotes(self, parent: Element) -> None: ...

class FootnotePostprocessor(Postprocessor):
footnotes: FootnoteExtension
Expand Down
Loading