mirror of
https://github.com/zensical/zensical.git
synced 2026-09-24 15:25:40 +00:00
fix: ignore links in code after literal dollar during link validation (#691)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
@@ -1854,6 +1854,11 @@ class TestMath:
|
||||
refs = collect(md)
|
||||
assert len(refs) == 0
|
||||
|
||||
def test_no_math_inline_across_code(self) -> None:
|
||||
md = b"| <span>$<span> | `#!python 'ab$'` | `#!python '[abc]'` |"
|
||||
refs = collect(md)
|
||||
assert len(refs) == 0
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"md",
|
||||
[
|
||||
|
||||
@@ -1042,6 +1042,8 @@ def _scan_math_inline(cursor: Cursor) -> int | None:
|
||||
|
||||
# Scan for closing $
|
||||
while end < cursor.end and cursor.data[end] not in (_CR, _NL):
|
||||
if cursor.data[end] == _BACKTICK:
|
||||
return None
|
||||
if (
|
||||
cursor.data[end] == _DOLLAR
|
||||
# Closing $ must not be preceded by whitespace or $
|
||||
|
||||
Reference in New Issue
Block a user