Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
MarkdownParser.parse()raisesAttributeErrorfor targets such as[example](./linked.md#section\ncontinued): the outer pattern accepts the target, but the fragment/query splitter returnsNone. Preserve the original target in that case, so parsing continues and valid neighboring links still rewrite.Human Involvement
Related Issue
Fixes #7624. Independently reproduced fragment/query newline inputs. The real directory parser records the affected file as failed and keeps a healthy sibling; downstream server import failure was not verified.
Type of Change
Changes Made
Add the null check in the existing link owner and parameterize its existing public-parser contract test. No API, storage, or lifecycle contract changes.
Testing
macOS arm64, Python 3.14.10, pytest 9.0.2; isolated synthetic configuration and source SDK/bot paths. Published 0.5.3 native libraries were used for imports; no native service or model ran.
Expanded contract test on unmodified
90f4edcede4c: 2 failed, 1 passed, both failures atm.group()..venv/bin/python -m pytest tests/parse/test_markdown_link_rewrite.py -q --no-cov: 46 passed..venv/bin/python -m pytest tests/parse/test_markdown_apply_layout.py tests/parse/test_markdown_filename_collision.py tests/parse/test_markdown_no_split.py tests/parse/test_markdown_split_token_budget.py tests/parse/test_markdown_local_image_refs.py -q --no-cov: 34 passed.Temporary
test_scripts/probe: 24 real Markdown/directory parser scenarios withLocalParseOutputStore, covering split/no-split, LF/CRLF, crossing a fence, and plain/external controls. All source files emit with the original text and a rewritten valid link; no directoryfailed_filesremain.Ruff lint/format on both changed paths and
git diff --check: passed..venv/bin/mypy --no-incremental openviking/parse/parsers/markdown.py tests/parse/test_markdown_link_rewrite.py: 2189 baseline / 2187 patched errors across imported modules; no new diagnostics after normalizing shifted lines. The two removed errors are the nullablem.group()accesses. Exact original files were checked via--shadow-filein the same environment.Regression coverage added to the existing contract
Related tests passed locally
Tested on macOS
Checklist
Additional Notes
Seven existing dependency/Pydantic warnings remain. The full suite, server import outcome, and other operating systems were not tested.