Skip to content

fix(rss): convert Atom feeds without entries - #2478

Open
RKS (rksharma-owg) wants to merge 1 commit into
microsoft:mainfrom
rksharma-owg:fix/empty-atom-feeds
Open

fix(rss): convert Atom feeds without entries#2478
RKS (rksharma-owg) wants to merge 1 commit into
microsoft:mainfrom
rksharma-owg:fix/empty-atom-feeds

Conversation

@rksharma-owg

Copy link
Copy Markdown

A namespace-qualified Atom feed with no entries currently fails RssConverter.convert() with ValueError: Unknown feed type. Through MarkItDown.convert_stream(), it falls back to raw XML instead of rendering the feed title and subtitle. RFC 4287 section 4.1.1 permits zero entry elements.

The detection code incorrectly requires an entry even when the root declares the Atom namespace. Accept that namespace-qualified root without entries, while preserving the existing entry heuristic for unqualified feeds. For example, an empty release feed now produces # Release updates and its subtitle, No releases yet.

Regression tests cover default and explicit namespace prefixes, extension and MIME detection, stream-position preservation, direct conversion, and the public API. Negative cases retain rejection of entryless unqualified or unrelated-namespace XML. The README notes support for Atom feeds without entries. No related issue was found in the issue and PR searches.

Validation on macOS / Python 3.12.13:

  • Before the fix: all eight empty-Atom regression cases failed; both unrelated-XML controls passed.
  • RSS/Atom tests: 173 passed (pytest tests/test_rss_converter.py tests/test_rss_titles.py -q).
  • Full package suite: 873 passed, 43 skipped (hatch test --python 3.12, with GITHUB_ACTIONS=true and OPENAI_API_KEY unset to use the existing remote/LLM skip conditions).
  • pre-commit run --all-files: passed.
  • hatch build -t wheel: passed.
  • git diff --check: passed.

The patch and tests were prepared with assistance from OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant