INNER CODE UNIT · Python
markdown_match_is_advisory
uvwt/agentdock · core-skills/skill-authoring/run.py:159
def markdown_match_is_advisory(content: str, start: int) -> bool:
lines = content.splitlines()
line_index = content.count("\n", 0, start)
current = lines[line_index].strip() if line_index < len(lines) else ""
if has_advisory_marker(current):
return True
if not LIST_ITEM_PATTERN.match(current):
return False
# 列表中的禁止项只继承同一列表前的说明句,不读取任意邻近段落。
for previous in reversed(lines[:line_index]):
stripped = previous.strip()
if not stripped:
continue
if LIST_ITEM_PATTERN.match(stripped):
continue
return has_advisory_marker(stripped)
return False