fix: ignore comment blocks in discussion parsing

This commit is contained in:
rob 2025-11-01 14:22:36 -03:00
parent 82aee9ef63
commit eed12ce749
1 changed files with 10 additions and 0 deletions

View File

@ -46,11 +46,21 @@ def extract_structured_basic(text: str) -> dict[str, list]:
mentions: list[dict[str, str]] = [] mentions: list[dict[str, str]] = []
timeline_data: dict[str, str] | None = None timeline_data: dict[str, str] | None = None
in_comment = False
for line in text.splitlines(): for line in text.splitlines():
participant, remainder = _extract_participant(line) participant, remainder = _extract_participant(line)
stripped = line.strip() stripped = line.strip()
if not stripped: if not stripped:
continue continue
if stripped.startswith("<!--"):
if not stripped.endswith("-->"):
in_comment = True
continue
if in_comment:
if stripped.endswith("-->"):
in_comment = False
continue
if stripped.startswith("#"): if stripped.startswith("#"):
continue continue
analysis = remainder.strip() if participant else stripped analysis = remainder.strip() if participant else stripped