lint code

This commit is contained in:
phernandez
2025-02-12 22:39:22 -06:00
parent c394d682e1
commit 28513c8b8d
29 changed files with 35 additions and 89 deletions
+1 -21
View File
@@ -160,24 +160,10 @@ def observation_plugin(md: MarkdownIt) -> None:
def observation_rule(state: Any) -> None:
"""Process observations in token stream."""
tokens = state.tokens
current_section = None
in_list_item = False
for idx in range(len(tokens)):
token = tokens[idx]
# Track current section by headings
if token.type == "heading_open":
next_token = tokens[idx + 1] if idx + 1 < len(tokens) else None
if next_token and next_token.type == "inline":
current_section = next_token.content.lower()
# Track list nesting
elif token.type == "list_item_open":
in_list_item = True
elif token.type == "list_item_close":
in_list_item = False
# Initialize meta for all tokens
token.meta = token.meta or {}
@@ -204,20 +190,14 @@ def relation_plugin(md: MarkdownIt) -> None:
def relation_rule(state: Any) -> None:
"""Process relations in token stream."""
tokens = state.tokens
current_section = None
in_list_item = False
for idx in range(len(tokens)):
token = tokens[idx]
# Track current section by headings
if token.type == "heading_open":
next_token = tokens[idx + 1] if idx + 1 < len(tokens) else None
if next_token and next_token.type == "inline":
current_section = next_token.content.lower()
# Track list nesting
elif token.type == "list_item_open":
if token.type == "list_item_open":
in_list_item = True
elif token.type == "list_item_close":
in_list_item = False