Repository navigation
fix(ingest): skip reference-style badges and badge URLs with parentheses - #18
Merged
Merged
Conversation
- Badge rows like `[![CI][ci-badge]][ci]` and their `[label]: url` definition lines no longer end up in the summary. - Badge URLs may contain one level of parentheses. Brackets stay out of alt text, labels and URLs, so matching stays linear.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Two badge cases still ended up in a project's summary after #17.
[![CI][ci-badge]][ci] ![Cov][cov]weren't recognised. They are now, and so are their[ci-badge]: https://…definition lines; without that, a definition line became the summary once the badge row was skipped. A link inside a sentence, likeSee [a][b] for more., stays.https://x/w_(a).svg, didn't match. URLs may now hold one level of parentheses.Tests: the reference-badge test failed before the fix, with the badge row as the summary. A new test runs CodeQL's earlier backtracking input and three other crafted lines, each under 100 ms.
npm run check && npm run lint && npm test && npm run buildexits 0 (24 tests). URLs with nested parentheses, likea_(b_(c)), are still not recognised.