fix: skip readability after explicit article match#4
Merged
Conversation
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.
Summary
Explicit article containers are now returned before falling back to Mozilla Readability parsing. This preserves the Tistory-style article body that the direct selector already identified, even if Readability would fail or choose surrounding page chrome.
Changes
Readability.parse().QA / Evidence
npm run check: typecheck and Biome passed./Users/yeongyu/local-workspaces/senpi/.omo/evidence/webfetch-tistory-worktree-pr/external-npm-run-check-after-explicit.txtnpm test: full Vitest suite passed, 4 files / 35 tests./Users/yeongyu/local-workspaces/senpi/.omo/evidence/webfetch-tistory-worktree-pr/external-vitest-full-after-explicit.txtnpm test -- test/webfetch-explicit-article.test.tspassed./Users/yeongyu/local-workspaces/senpi/.omo/evidence/webfetch-tistory-worktree-pr/external-explicit-article-green.txtRisks
Low. The change only short-circuits after an existing explicit article selector has already passed the minimum text threshold; generic pages still use the existing Readability fallback.
Secret safety
Evidence contains command output only. No tokens, auth headers, cookies, or credential-bearing logs are included.
Summary by cubic
Return explicit article containers before running
@mozilla/readabilityto preserve Tistory-style article bodies and avoid failures when Readability mis-parses or throws. Fixes cases where page chrome was selected or parsing failed.Readability.parse().@mozilla/readabilityand verifies skipping while producing the expected markdown.Written for commit a5a65a7. Summary will update on new commits.