fix: link-aware truncation in changelog parser (#11)#14
Merged
Conversation
Hard 140-char cut on changelog bullets landed inside `[label](url)`, producing broken markdown that confuses LLM consumers of the generated doc. After the cut, strip any unclosed `[label](url` or `[label` at the tail. Applied to both code paths: - `_parse_changelog_content` (raw CHANGELOG.md, bash) - `fetch_github_release_notes` (GitHub Releases API, jq) Closes #11 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codex review of #14 flagged that nested CommonMark labels like `[outer [inner](u1)](url` aren't fully cleaned by the flat regex. Real fix needs a markdown-aware parser; in practice release notes use flat links. Document as a known limitation and track as follow-up rather than ship a half-baked nesting heuristic. Add two boundary cases (exact-140 input, empty input) for cheap robustness coverage.
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.
Summary
_truncate_safehelper[label](urlor[labelleft at the tail after truncation_parse_changelog_content(bash) andfetch_github_release_notes(jq)Closes #11.
Test plan
tests/test_github_truncate.sh— 9 cases covering the helper unit + integration through_parse_changelog_contentBefore / after
For
avo (3.20.1)first bullet, where the link extends past the 140-char budget:The dangling
[avo-dynamic_filters #91](https://github.com/avo-hq/avo-d...is gone — the; refactorjoin is clean.Notes
🤖 Generated with Claude Code