chore: fix lint

This commit is contained in:
Austin Pickett 2026-04-24 12:32:10 -04:00
parent 63975aa75b
commit 5500b51800
11 changed files with 171 additions and 3 deletions

View file

@ -120,6 +120,14 @@ def mdx_escape_body(body: str) -> str:
elif ch == "}":
out.append("}")
elif ch == "<":
# Preserve full HTML comments (e.g. ascii-guard ignore markers) — they
# are not HTML tags, so the tag regex below would escape the leading <.
if text[i:].startswith("<!--"):
end = text.find("-->", i)
if end != -1:
out.append(text[i : end + 3])
i = end + 3
continue
# Look ahead to see if this is a valid HTML-ish tag.
# If it looks like a tag name then alnum/-/_ chars, leave it.
# Otherwise escape.