mirror of
https://github.com/zensical/zensical.git
synced 2026-08-23 07:36:52 +00:00
fix: regression reporting unresolved references (#866)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user