feat(namespace): add GeoRSS, Creative Commons, and ParseOptions API#22
Merged
feat(namespace): add GeoRSS, Creative Commons, and ParseOptions API#22
Conversation
Implements Phase 1 of feedparser parity gap analysis:
- Add GeoRSS namespace support for geographic location data
- Supports point, line, polygon, and box elements
- Coordinate validation and parsing
- Add Creative Commons namespace for license metadata
- Supports cc:license with rdf:resource attribute
- Supports legacy creativeCommons:license text element
- Converts licenses to links with rel="license"
- Add ParseOptions API for parser configuration
- resolve_relative_uris: URL resolution control
- sanitize_html: HTML sanitization toggle
- limits: ParserLimits integration
- Presets: default(), strict(), permissive()
- Enhanced date parsing
- Year-only format ("2024")
- Year-month format ("2024-12")
c6f77ad to
9fd6c90
Compare
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #22 +/- ##
==========================================
+ Coverage 90.21% 90.75% +0.53%
==========================================
Files 29 32 +3
Lines 5714 6175 +461
==========================================
+ Hits 5155 5604 +449
- Misses 559 571 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 1 of the feedparser parity gap analysis by adding GeoRSS namespace support for geographic data, Creative Commons namespace for license metadata, and a ParseOptions API for parser configuration. The implementation also enhances date parsing to support year-only and year-month formats.
Key changes:
- New GeoRSS namespace handler with support for point, line, polygon, and box geometries
- Creative Commons namespace handler for license information with backward compatibility
- ParseOptions API providing default, strict, and permissive configuration presets
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/feedparser-rs-core/src/namespace/georss.rs | Implements GeoRSS namespace parsing with coordinate validation and geometry types |
| crates/feedparser-rs-core/src/namespace/cc.rs | Handles Creative Commons licenses, converting them to links with rel="license" |
| crates/feedparser-rs-core/src/options.rs | Provides ParseOptions API with presets for different security/performance profiles |
| crates/feedparser-rs-core/src/util/date.rs | Adds support for year-only and year-month date formats |
| crates/feedparser-rs-core/src/types/entry.rs | Adds geo field to Entry for GeoRSS location data |
| crates/feedparser-rs-core/src/namespace/mod.rs | Registers new namespaces and their URI mappings |
| crates/feedparser-rs-core/src/lib.rs | Exports ParseOptions in public API |
Clippy's doc_markdown lint requires backticks for mixed-case identifiers like GeoRSS. The Copilot suggestion was incorrect - reverting to pass CI.
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
Implements Phase 1 of feedparser parity gap analysis to close gaps between feedparser-rs and Python feedparser.
New Features
GeoRSS namespace support for geographic location data
georss:point,georss:line,georss:polygon,georss:boxelementsGeoTypeenum andGeoLocationstructCreative Commons namespace for license metadata
cc:licensewithrdf:resourceattributecreativeCommons:licensetext elementrel="license"ParseOptions API for parser configuration
resolve_relative_uris: URL resolution controlsanitize_html: HTML sanitization togglelimits: ParserLimits integrationdefault(),strict(),permissive()Enhanced date parsing
Files Changed
crates/feedparser-rs-core/src/namespace/georss.rs- GeoRSS namespace handlercrates/feedparser-rs-core/src/namespace/cc.rs- Creative Commons handlercrates/feedparser-rs-core/src/options.rs- ParseOptions APIcrates/feedparser-rs-core/src/util/date.rs- Additional date formatscrates/feedparser-rs-core/src/types/entry.rs- Addedgeofieldcrates/feedparser-rs-core/src/namespace/mod.rs- Module exportscrates/feedparser-rs-core/src/lib.rs- Public API exportsTest plan
cargo nextest run --workspace)cargo clippy --all-features --workspace -- -D warnings)