Repository navigation
fix(rules): links/broken-anchors flags script-named ids as unconfirmed on unrendered pages (#1616) - #1620
Closed
nc9 wants to merge 2 commits into
Closed
fix(rules): links/broken-anchors flags script-named ids as unconfirmed on unrendered pages (#1616)#1620nc9 wants to merge 2 commits into
nc9 wants to merge 2 commits into
Conversation
… as unconfirmed, not broken, on unrendered pages #1616 Signed-off-by: Nik Cubrilovic <[email protected]>
…emotes nothing; 1024 tokens of 64 chars; docs say name match #1616 Signed-off-by: Nik Cubrilovic <[email protected]>
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.
What
In HTTP-only mode a server-rendered page can create a target id from inline script at init (
el.id = "size"). The id is not in the fetched HTML, solinks/broken-anchorsreported the link as definitely broken, although a browser resolves it.The per-page anchor record now keeps the quoted id-like tokens from a page's inline code scripts (only when the page was not rendered; capped at 256 distinct tokens and 256 KB of script text, bounded and detached like the other record fields). A missing fragment that such a script names is reported under
unconfirmed-anchors(info). If the scripts were over a cap, no missing id on that page is confirmed.unconfirmed-anchorsmessage no longer says "client-rendered page" (it now covers server-rendered pages): "target a page that was not rendered and may add the id with JavaScript".Tests
packages/rules/tests/broken-anchors.test.ts, both engines (DOM and streaming collector): script-set id unconfirmed, missing still warns, static passes, id inside an HTML string, cross-page link, data scripts ignored, rendered mode, oversized script. Also rancollected-signals-retention-1565,single-page-site,link-sources-837,docs-rule-pages, the audit-engine broken-anchors and canonical goldens,make validate, oxlint, tsgo onpackages/rules. Fixtures use invented text.CHANGELOG bullet under Unreleased;
docs/rules/links/broken-anchors.mdxupdated. The squirrelscan agent skill does not need a change.Closes #1616