Skip to content

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
cppalliance:masterfrom
sharmis-tp:issue-1-fallback
Open

sharmis-tp wants to merge 1 commit into
cppalliance:masterfrom
sharmis-tp:issue-1-fallback

Conversation

@sharmis-tp

Copy link
Copy Markdown
Collaborator

Part 1 of #1.

The whole-page rendering, used for raw and for the fallback, now leaves out script and style. noscript stays, 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, style and noscript on both paths. The share-rule test and the script/style test fail on master. The goldens are unchanged.

Scored with this crate's extract_html on the 15 saved pages from research/2026-11-20-web-fetch-measurements.md:

master this PR
Content phrases kept 35/49 (71%) 45/49 (92%)
Pages with every phrase 7 11
Boilerplate phrases leaked 6/37 10/37

The issue #1 profile, lobste.rs, DuckDuckGo and a GitHub profile now come back whole. The crates.io page no longer shows its window.onerror and 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.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8226f031-1bd0-4591-b6f3-3316311eac6b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant