diff --git a/python/tests/unit/collectors/test_references.py b/python/tests/unit/collectors/test_references.py index 06b6a56..a90a50c 100644 --- a/python/tests/unit/collectors/test_references.py +++ b/python/tests/unit/collectors/test_references.py @@ -1624,6 +1624,10 @@ class TestFencedCodeBlocks: b"``` python\n[text](href)\n```", id="fenced-code-3-backticks-lang", ), + pytest.param( + b"```text\n[text](href)\n\nline two\n```", + id="fenced-code-3-backticks-lang-without-space", + ), pytest.param( b"````\n[text](href)\n````", id="fenced-code-4-backticks", diff --git a/python/zensical/collectors/references/cursor.py b/python/zensical/collectors/references/cursor.py index ebd12ae..9faa83a 100644 --- a/python/zensical/collectors/references/cursor.py +++ b/python/zensical/collectors/references/cursor.py @@ -220,17 +220,12 @@ def _scan(cursor: Cursor) -> Iterator[Reference]: if ( cursor.at_line_start() and count >= 3 # noqa: PLR2004 - and cursor.peek(count) in (_SPACE, _TAB, _CR, _NL, -1) ): end = _scan_fenced_code(cursor, _BACKTICK) if end is not None: cursor.advance(end - cursor.pos) continue - # Literal - cursor.advance(count) - continue - # Inline code: `...` end = _scan_inline_code(cursor) if end is not None: