Skip to content

Commit

Permalink
Addresses typing errors fomr #1829
Browse files Browse the repository at this point in the history
  • Loading branch information
miteshashar committed Jul 31, 2023
1 parent a30a705 commit c014b6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions funnel/utils/markdown/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ClassVar,
Dict,
Iterable,
Mapping,
Optional,
Set,
Union,
Expand Down Expand Up @@ -49,8 +50,6 @@

# --- Markdown dataclasses -------------------------------------------------------------

OptionStrings = Literal['html', 'breaks', 'linkify', 'typographer']


@dataclass
class MarkdownPlugin:
Expand Down Expand Up @@ -89,7 +88,7 @@ class MarkdownConfig:
'default', 'zero', 'commonmark', 'js-default', 'gfm-like'
] = 'commonmark'
#: Updated options against the preset
options_update: Optional[Dict[OptionStrings, bool]] = None
options_update: Optional[Mapping[str, Any]] = None
#: Allow only inline rules (skips all block rules)?
inline: bool = False

Expand Down
4 changes: 2 additions & 2 deletions funnel/utils/markdown/mdit_plugins/abbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from markdown_it import MarkdownIt
from markdown_it.rules_block import StateBlock
from markdown_it.rules_inline import StateInline
from markdown_it.rules_core import StateCore
from markdown_it.token import Token

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


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

Expand Down
4 changes: 2 additions & 2 deletions funnel/utils/markdown/mdit_plugins/heading_anchors_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from __future__ import annotations

from markdown_it import MarkdownIt
from markdown_it.rules_inline import StateInline
from markdown_it.rules_core import StateCore

__all__ = ['heading_anchors_fix_plugin']


def heading_anchors_fix(state: StateInline) -> None:
def heading_anchors_fix(state: StateCore) -> None:
prev_token = None

for token in state.tokens:
Expand Down
3 changes: 2 additions & 1 deletion funnel/utils/markdown/mdit_plugins/toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from markdown_it import MarkdownIt
from markdown_it.renderer import OptionsDict, RendererHTML
from markdown_it.rules_core import StateCore
from markdown_it.rules_inline import StateInline
from markdown_it.token import Token

Expand Down Expand Up @@ -253,7 +254,7 @@ def toc_body(
html = toc_item_to_html(toc, opts, md)
return html

def grab_state(state: StateInline):
def grab_state(state: StateCore):
state.env['gstate'] = state

md.core.ruler.push('grab_state', grab_state)
Expand Down

0 comments on commit c014b6a

Please sign in to comment.