fix: anchors with escaped chars not matched during link validation (#703)

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
squidfunk
2026-05-22 09:39:16 +02:00
parent 8b7e29e672
commit d7ccbe66a8
3 changed files with 100 additions and 22 deletions
@@ -1446,6 +1446,15 @@ class TestFootnoteReferences:
assert text(md, link_refs[0].text) == expected_id
assert text(md, link_refs[0].id) == expected_id
def test_no_footnote_ref_escaped_id(self) -> None:
md = b"[^a\\_b]\n\n[^a_b]: note"
refs = collect(md)
assert len(refs) == 1
note_defs = footnote_defs_only(refs)
assert len(note_defs) == 1
assert text(md, note_defs[0].id) == b"a_b"
# ---------------------------------------------------------------------------