diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d326cc2..553f4f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,4 +38,4 @@ repos: rev: v1.3.0 hooks: - id: mypy - additional_dependencies: [markdown-it-py~=2.0] + additional_dependencies: [markdown-it-py~=3.0] diff --git a/mdit_py_plugins/attrs/index.py b/mdit_py_plugins/attrs/index.py index 77c2681..be29596 100644 --- a/mdit_py_plugins/attrs/index.py +++ b/mdit_py_plugins/attrs/index.py @@ -140,7 +140,7 @@ def _span_rule(state: StateInline, silent: bool): state.pos = labelStart state.posMax = labelEnd token = state.push("span_open", "span", 1) - token.attrs = attrs + token.attrs = attrs # type: ignore state.md.inline.tokenize(state) token = state.push("span_close", "span", -1) diff --git a/mdit_py_plugins/footnote/index.py b/mdit_py_plugins/footnote/index.py index 6a0a875..e7ef4b0 100644 --- a/mdit_py_plugins/footnote/index.py +++ b/mdit_py_plugins/footnote/index.py @@ -6,6 +6,7 @@ from markdown_it import MarkdownIt from markdown_it.helpers import parseLinkLabel from markdown_it.rules_block import StateBlock +from markdown_it.rules_core import StateCore from markdown_it.rules_inline import StateInline from markdown_it.token import Token @@ -253,7 +254,7 @@ def footnote_ref(state: StateInline, silent: bool): return True -def footnote_tail(state: StateBlock, *args, **kwargs): +def footnote_tail(state: StateCore) -> None: """Post-processing step, to move footnote tokens to end of the token stream. Also removes un-referenced tokens. diff --git a/mdit_py_plugins/utils.py b/mdit_py_plugins/utils.py index 350a3b7..bd8db4e 100644 --- a/mdit_py_plugins/utils.py +++ b/mdit_py_plugins/utils.py @@ -5,7 +5,7 @@ def is_code_block(state: StateBlock, line: int) -> bool: """Check if the line is part of a code block, compat for markdown-it-py v2.""" try: # markdown-it-py v3+ - return state.is_code_block(line) # type: ignore[attr-defined] + return state.is_code_block(line) except AttributeError: pass diff --git a/pyproject.toml b/pyproject.toml index fe022bf..08db7f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] keywords = ["markdown", "markdown-it", "lexer", "parser", "development"] requires-python = ">=3.8" -dependencies = ["markdown-it-py>=1.0.0,<3.0.0"] +dependencies = ["markdown-it-py>=1.0.0,<4.0.0"] [project.urls] Homepage = "https://github.com/executablebooks/mdit-py-plugins"