Repository navigation
Fall back to the whole page when the article is a small part of it - #8
Open
sharmis-tp wants to merge 1 commit into
Open
sharmis-tp wants to merge 1 commit into
sharmis-tp wants to merge 1 commit into
Conversation
…nd leave script and style out of it
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Part 1 of #1.
The whole-page rendering, used for
rawand for the fallback, now leaves outscriptandstyle.noscriptstays, because Discourse serves its topic list in it.The fallback now fires when the article is under 250 characters, or under 3,000 characters and under a fifth of the whole page, as in the field survey. Before, it fired only under 100 characters, so a profile or a list of links came back as one small fragment. An article of 3,000 characters or more is returned without rendering the whole page.
The two tests from the description of #1 are added as they are, and both pass. Three more cover the 20% rule in both directions and
script,styleandnoscripton both paths. The share-rule test and the script/style test fail on master. The goldens are unchanged.Scored with this crate's
extract_htmlon the 15 saved pages from research/2026-11-20-web-fetch-measurements.md:The issue #1 profile, lobste.rs, DuckDuckGo and a GitHub profile now come back whole. The crates.io page no longer shows its
window.onerrorand SvelteKit bootstrap code. The new leaks are navigation text that the whole page brings back ("Sign in", "Navigation Menu", the DuckDuckGo region list).Part 2, the title line and a note of how much the extraction kept, follows in its own PR.