Skip to content

Commit

Permalink
Update index.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Sep 9, 2024
1 parent 5371f39 commit 9cb4c29
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mdit_py_plugins/attrs/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _attr_inline_rule(
silent: bool,
after: Sequence[str],
*,
allowed_attributes: set[str] | None = None,
allowed: set[str] | None = None,
) -> bool:
if state.pending or not state.tokens:
return False
Expand All @@ -177,7 +177,7 @@ def _attr_inline_rule(
attr_token = state.tokens[token_index]
if "class" in attrs and "class" in token.attrs:
attrs["class"] = f"{token.attrs['class']} {attrs['class']}"
_add_attrs(attr_token, attrs, allowed_attributes)
_add_attrs(attr_token, attrs, allowed)
return True


Expand Down Expand Up @@ -229,9 +229,7 @@ def _attr_block_rule(
return True


def _attr_resolve_block_rule(
state: StateCore, *, allowed_attributes: set[str] | None
) -> None:
def _attr_resolve_block_rule(state: StateCore, *, allowed: set[str] | None) -> None:
"""Find attribute block then move its attributes to the next block."""
i = 0
len_tokens = len(state.tokens)
Expand All @@ -255,7 +253,7 @@ def _attr_resolve_block_rule(
if key == "class" or key not in next_token.attrs:
next_token.attrs[key] = value
else:
_add_attrs(next_token, state.tokens[i].attrs, allowed_attributes)
_add_attrs(next_token, state.tokens[i].attrs, allowed)

state.tokens.pop(i)
len_tokens -= 1
Expand Down

0 comments on commit 9cb4c29

Please sign in to comment.