OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug]: A Markdown link target that spans lines raises AttributeError and fails the whole directory import

Open ragnos-dev opened this issue 2 weeks ago • 0 comments

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.

ragnos-dev avatar Nov 13 '26 14:11 ragnos-dev