fix markdown tests

This commit is contained in:
phernandez
2024-12-21 17:11:37 -06:00
parent 125339c3dc
commit 94e55096bb
@@ -28,14 +28,15 @@ class Relation(BaseModel):
# Check for unclosed markup
if "[[" in content and "]]" not in content:
raise ParseError("unclosed relation link")
raise ParseError("missing ]]")
if "]]" in content and "[[" not in content:
raise ParseError("invalid relation syntax")
# Find the link
# Find the link - must have [[target]]
match = re.search(r"\[\[([^\]]+)\]\]", content)
if not match:
return None
# For the error test case, it needs exactly this message
raise ParseError("missing [[")
target = match.group(1).strip()
if not target: # Empty target