Repository navigation
Keep article pictures readeck drops - #113
Merged
Merged
Conversation
readeck drops pictures inside buttons and hidden tab panels, and figures whose caption is mostly a link inside formatting. Sites use all three for article pictures: a screenshot that opens full size, one chart of a group shown at a time, an italic source credit. keepPictures prepares these elements before readeck parses the page. When it changes the page, readeck parses the original page too, and the prepared result is used only if it keeps every picture and all the text of the original one.
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.
Previously, readeck dropped article pictures in three cases: pictures inside a
<button>, charts in hidden tab panels, and figures whose caption is mostly a link inside formatting.After this change,
keepPicturesprepares the page before readeck parses it:keepPicturesleaves out icons (svg, or declared under 64 px), thumbnails of pictures the page already shows, tabs, buttons inside links, hidden buttons and quote carousels.Recovered pictures can make readeck discard the element that holds them, together with pictures it kept before. So when
keepPictureschanges the page, readeck parses both versions. The prepared result is used only if it keeps every picture and all the text of the original result. If the original parse finds no article, the hidden-element pass and the media-only fallback apply as before.Across 578 saved articles compared with master, 19 pages gain pictures (zed.dev's 1.0 post 1 → 6, one chart each on six Substack posts) and none loses any. The only added text is captions. Mean text F1 moves from 0.9253 to 0.9251, because the reference text omits the recovered captions of one anthropic.com post, which is in the set at two URLs.
Each test fails when the rule or guard it covers is reverted.