Skip to content

Commit c014b6a

Browse files
committed
Addresses typing errors fomr #1829
1 parent a30a705 commit c014b6a

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

funnel/utils/markdown/base.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ClassVar,
1010
Dict,
1111
Iterable,
12+
Mapping,
1213
Optional,
1314
Set,
1415
Union,
@@ -49,8 +50,6 @@
4950

5051
# --- Markdown dataclasses -------------------------------------------------------------
5152

52-
OptionStrings = Literal['html', 'breaks', 'linkify', 'typographer']
53-
5453

5554
@dataclass
5655
class MarkdownPlugin:
@@ -89,7 +88,7 @@ class MarkdownConfig:
8988
'default', 'zero', 'commonmark', 'js-default', 'gfm-like'
9089
] = 'commonmark'
9190
#: Updated options against the preset
92-
options_update: Optional[Dict[OptionStrings, bool]] = None
91+
options_update: Optional[Mapping[str, Any]] = None
9392
#: Allow only inline rules (skips all block rules)?
9493
inline: bool = False
9594

funnel/utils/markdown/mdit_plugins/abbr.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from markdown_it import MarkdownIt
1212
from markdown_it.rules_block import StateBlock
13-
from markdown_it.rules_inline import StateInline
13+
from markdown_it.rules_core import StateCore
1414
from markdown_it.token import Token
1515

1616
__all__ = ['abbr_plugin']
@@ -57,7 +57,7 @@ def abbr_def(state: StateBlock, start_line: int, end_line: int, silent: bool) ->
5757
return True
5858

5959

60-
def abbr_replace(state: StateInline) -> None:
60+
def abbr_replace(state: StateCore) -> None:
6161
"""Tokenizes and tags defined abbreviations in content."""
6262
block_tokens = state.tokens
6363

funnel/utils/markdown/mdit_plugins/heading_anchors_fix.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from __future__ import annotations
44

55
from markdown_it import MarkdownIt
6-
from markdown_it.rules_inline import StateInline
6+
from markdown_it.rules_core import StateCore
77

88
__all__ = ['heading_anchors_fix_plugin']
99

1010

11-
def heading_anchors_fix(state: StateInline) -> None:
11+
def heading_anchors_fix(state: StateCore) -> None:
1212
prev_token = None
1313

1414
for token in state.tokens:

funnel/utils/markdown/mdit_plugins/toc.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from markdown_it import MarkdownIt
2222
from markdown_it.renderer import OptionsDict, RendererHTML
23+
from markdown_it.rules_core import StateCore
2324
from markdown_it.rules_inline import StateInline
2425
from markdown_it.token import Token
2526

@@ -253,7 +254,7 @@ def toc_body(
253254
html = toc_item_to_html(toc, opts, md)
254255
return html
255256

256-
def grab_state(state: StateInline):
257+
def grab_state(state: StateCore):
257258
state.env['gstate'] = state
258259

259260
md.core.ruler.push('grab_state', grab_state)

0 commit comments

Comments
 (0)