Skip to content

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Jan 14, 2026

Summary

  • Fix RSS parsing to properly handle self-closing (empty) XML elements
  • Root cause: skip_element() was called for empty elements expecting a closing tag
  • This consumed subsequent XML events and broke parsing of <item> elements

Changes

  • Add is_empty flag propagation through parse_channel and parse_item functions
  • Skip skip_element() calls when is_empty=true at both channel and item level
  • Fix enclosure element handling (enclosures are always self-closing)
  • Populate feed.feed.image from itunes:image for empty elements

Test Plan

  • Added 16 comprehensive tests covering various empty element scenarios
  • All 616 tests pass
  • Clippy clean with -D warnings
  • Code formatted with cargo +nightly fmt
  • cargo deny check passes

Closes #45

Fix RSS parsing to properly handle self-closing (empty) XML elements
like `<atom:link href="..." />`. Previously, skip_element() was called
for these elements expecting a closing tag that doesn't exist, which
consumed subsequent XML events and broke parsing.

Changes:
- Add is_empty flag propagation through parse_channel and parse_item
- Skip skip_element() calls when is_empty=true at both channel and item level
- Fix enclosure element handling (always self-closing)
- Populate feed.feed.image from itunes:image for empty elements

Closes #45
@github-actions github-actions bot added type: tooling Development tools, CI/CD, or infrastructure component: core feedparser-rs-core Rust library component: python Python bindings (PyO3) component: node Node.js bindings (napi-rs) component: tests Test suite or test infrastructure area: parser Feed parsing logic area: rss RSS 0.9x, 1.0, 2.0 support lang: rust Rust code size: XL Extra large PR (<1000 lines changed) labels Jan 14, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 75.15924% with 39 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/feedparser-rs-core/src/parser/rss.rs 75.15% 39 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
- Coverage   91.84%   91.68%   -0.16%     
==========================================
  Files          34       34              
  Lines        7758     7816      +58     
==========================================
+ Hits         7125     7166      +41     
- Misses        633      650      +17     
Flag Coverage Δ
rust-core 91.68% <75.15%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/feedparser-rs-core/src/parser/rss.rs 94.11% <75.15%> (-0.74%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Update version in all manifests:
- Cargo.toml (workspace)
- package.json (Node.js)
- pyproject.toml (Python)
- uv.lock

Update CHANGELOG.md with 0.4.2 release notes for issue #45 fix.
@github-actions github-actions bot added type: documentation Improvements or additions to documentation type: build Build system, dependencies, or tooling component: dependencies Dependency updates or management lang: python Python code lang: javascript JavaScript/TypeScript code labels Jan 14, 2026
@bug-ops bug-ops merged commit 4ed0981 into main Jan 14, 2026
31 checks passed
@bug-ops bug-ops deleted the fix/issue-45-empty-element-parsing branch January 14, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: parser Feed parsing logic area: rss RSS 0.9x, 1.0, 2.0 support component: core feedparser-rs-core Rust library component: dependencies Dependency updates or management component: node Node.js bindings (napi-rs) component: python Python bindings (PyO3) component: tests Test suite or test infrastructure lang: javascript JavaScript/TypeScript code lang: python Python code lang: rust Rust code size: XL Extra large PR (<1000 lines changed) type: build Build system, dependencies, or tooling type: documentation Improvements or additions to documentation type: tooling Development tools, CI/CD, or infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSS 2.0 with atom namespace

3 participants