OpenViking
OpenViking copied to clipboard
[Bug]: A Markdown link target that spans lines raises AttributeError and fails the whole directory import
Version
OpenViking v0.5.4 (9dfa9017a). The same code is on current main (checked 2026-11-13).
Summary
In openviking/parse/parsers/markdown.py, when the link regular expression matches text that spans lines (for example across a code fence), _MD_FRAGMENT_RE.match(raw) returns None and the next line calls m.group(1), raising AttributeError. One such file fails the import of the whole directory.
Reproduction
Import a directory containing a Markdown file with a [text]( opening before a fenced code block and the closing ) after it.
Proposed fix
When the fragment pattern does not match, return the link unchanged (it is not a local path). Four lines; happy to open a PR.