Commit b8dc6ad
authored
feat(parser): add xml:lang tracking and license field support (#27)
* feat: complete *_detail structures with xml:lang and license support
Add comprehensive xml:lang tracking to RSS parser and license field
support across all feed formats to complete Phase 2 of *_detail
infrastructure.
Changes:
- Add extract_xml_lang() helper function to parser/common.rs
- Track xml:lang at RSS channel and item levels with inheritance
- Populate TextConstruct.language for title and description fields
- Add license field to FeedMeta and Entry types
- Parse creativeCommons:license and plain license tags in RSS
- Extract license from link rel="license" in Atom feeds
- Update Python and Node.js bindings with license getters
- Add comprehensive integration tests for xml:lang and license
The RSS parser now properly tracks xml:lang attributes on channel
and item elements, propagating language information to TextConstruct
fields. Item-level xml:lang overrides channel-level language, matching
standard XML behavior.
License URLs are extracted from both RSS (creativeCommons:license,
license tags) and Atom (link rel="license") feeds, stored in the
license field for both feed and entry metadata.
Tests: 476 passed, clippy clean, all CI checks passing
* fix(node): add license field to TypeScript definitions
Add missing license field to Entry and FeedMeta interfaces in TypeScript
definitions. This field was already implemented in the Rust code but was
not exposed in the type definitions.
Also add test for empty xml:lang attribute handling to verify edge case
behavior.
* style: apply nightly rustfmt formatting1 parent 066ab85 commit b8dc6ad
File tree
9 files changed
+316
-17
lines changed- crates
- feedparser-rs-core/src
- parser
- types
- feedparser-rs-node
- src
- feedparser-rs-py/src/types
9 files changed
+316
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
305 | 309 | | |
306 | 310 | | |
307 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
308 | 315 | | |
309 | 316 | | |
310 | 317 | | |
| |||
926 | 933 | | |
927 | 934 | | |
928 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
929 | 977 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
288 | 329 | | |
289 | 330 | | |
290 | 331 | | |
| |||
0 commit comments