Content extractor — jsoup content + metadata extraction#12
Merged
Conversation
- ExtractedContent record (body + title/excerpt/author/categories/ publishedDate/previewImage/locale; categories normalized). - ContentExtractor (@component, ContentLocaleResolver + ObjectMapper): reads metadata before stripping scripts (JSON-LD survives), then strips script/style/noscript/template + comments; selects the container via contentSelector (comma fallback, body = whole doc, readability fallback), removes contentExclude, and whitespace-normalizes to block-separated body. Metadata from OpenGraph/Article meta, JSON-LD (arrays/@graph), and <time datetime>; locale via the path rule. - ContentExtractorTest: 14 cases (selection/cleaning + metadata + edges). 66 tests green. - steps.md; refresh CLAUDE.md. Refs #11
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
ContentExtractorturns raw HTML into anExtractedContent(clean body + metadata) using jsoup: it selects the main container via the source'scontentSelector(comma fallback;body= whole doc; readability fallback), always strips scripts/styles/comments, removescontentExcludeelements, and whitespace-normalizes the body. Metadata (title, excerpt, date, author, categories, preview image, locale) is read independently from OpenGraph/Article<meta>, JSON-LD, and<time>. No indexing yet (spec 008).Spec
docs/specs/006-content-extractor/{design,behaviors,steps}.mdChanges
ExtractedContentrecordContentExtractor— body selection/cleaning + structured metadata extraction (metadata read before scripts are stripped, so JSON-LD survives)Test coverage
Closes #11
🤖 Generated with Claude Code