Skip to content

Commit

Permalink
Update mdit_py_plugins/attrs/index.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Sep 9, 2024
1 parent ca6e88d commit b302bc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mdit_py_plugins/attrs/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def _attr_inline_rule(state: StateInline, silent: bool) -> bool:
return False
try:
new_pos, attrs = parse(state.src[state.pos :])
if allowed_attributes is not None:
attrs = {k: v for k, v in attrs.items() if k in allowed_attributes}
token.meta["insecure_attrs"] = {
if allowed_attributes is not None and (disallowed := {
k: v for k, v in attrs.items() if k not in allowed_attributes
}
}):
token.meta["insecure_attrs"] = dissalowed
attrs = {k: v for k, v in attrs.items() if k in allowed_attributes}
except ParseError:
return False
token_index = _find_opening(state.tokens, len(state.tokens) - 1)
Expand Down

0 comments on commit b302bc6

Please sign in to comment.