Skip to content

Commit c297f7e

Browse files
authored
⬆️ UPGRADE: Allow markdown-it-py v3 (#85)
1 parent 6f2e2a7 commit c297f7e

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ repos:
3838
rev: v1.3.0
3939
hooks:
4040
- id: mypy
41-
additional_dependencies: [markdown-it-py~=2.0]
41+
additional_dependencies: [markdown-it-py~=3.0]

mdit_py_plugins/attrs/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _span_rule(state: StateInline, silent: bool):
140140
state.pos = labelStart
141141
state.posMax = labelEnd
142142
token = state.push("span_open", "span", 1)
143-
token.attrs = attrs
143+
token.attrs = attrs # type: ignore
144144
state.md.inline.tokenize(state)
145145
token = state.push("span_close", "span", -1)
146146

mdit_py_plugins/footnote/index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from markdown_it import MarkdownIt
77
from markdown_it.helpers import parseLinkLabel
88
from markdown_it.rules_block import StateBlock
9+
from markdown_it.rules_core import StateCore
910
from markdown_it.rules_inline import StateInline
1011
from markdown_it.token import Token
1112

@@ -253,7 +254,7 @@ def footnote_ref(state: StateInline, silent: bool):
253254
return True
254255

255256

256-
def footnote_tail(state: StateBlock, *args, **kwargs):
257+
def footnote_tail(state: StateCore) -> None:
257258
"""Post-processing step, to move footnote tokens to end of the token stream.
258259
259260
Also removes un-referenced tokens.

mdit_py_plugins/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def is_code_block(state: StateBlock, line: int) -> bool:
55
"""Check if the line is part of a code block, compat for markdown-it-py v2."""
66
try:
77
# markdown-it-py v3+
8-
return state.is_code_block(line) # type: ignore[attr-defined]
8+
return state.is_code_block(line)
99
except AttributeError:
1010
pass
1111

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
]
2626
keywords = ["markdown", "markdown-it", "lexer", "parser", "development"]
2727
requires-python = ">=3.8"
28-
dependencies = ["markdown-it-py>=1.0.0,<3.0.0"]
28+
dependencies = ["markdown-it-py>=1.0.0,<4.0.0"]
2929

3030
[project.urls]
3131
Homepage = "https://github.com/executablebooks/mdit-py-plugins"

0 commit comments

Comments
 (0)