-
Notifications
You must be signed in to change notification settings - Fork 0
feat(namespace): add GeoRSS, Creative Commons, and ParseOptions API #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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)