diff --git a/python/tests/unit/collectors/test_references.py b/python/tests/unit/collectors/test_references.py index cec0ca2..c0345ff 100644 --- a/python/tests/unit/collectors/test_references.py +++ b/python/tests/unit/collectors/test_references.py @@ -1389,6 +1389,11 @@ class TestFootnoteReferences: @pytest.mark.parametrize( ("md", "expected_id"), [ + pytest.param( + b"[^]", + b"", + id="footnote-ref-empty-id", + ), pytest.param( b"[^1]", b"1", @@ -1419,11 +1424,6 @@ class TestFootnoteReferences: @pytest.mark.parametrize( ("md", "expected_id"), [ - pytest.param( - b"[^]", - b"^", - id="link-ref", - ), pytest.param( b"[^ ]", b"^ ", diff --git a/python/zensical/collectors/references/cursor.py b/python/zensical/collectors/references/cursor.py index bc7f777..8db0550 100644 --- a/python/zensical/collectors/references/cursor.py +++ b/python/zensical/collectors/references/cursor.py @@ -871,10 +871,7 @@ def _scan_footnote_ref_or_def( if end >= cursor.end or cursor.data[end] != _RBRACKET: return None - # Skip if we didn't find an id id = cursor.span(start + 2, end) - if id.start == id.end: - return None # Validate id - non-empty, no internal spaces text = cursor.data[id.start : id.end]