markitdown
markitdown copied to clipboard
fix: initialize md_text in _parse_rss_type to prevent UnboundLocalError
Summary
_parse_rss_type only assigned md_text inside if channel_title:, so any RSS feed with no <title> in its <channel> caused an UnboundLocalError on the subsequent md_text += lines.
Fix
Initialize md_text = "" before the conditional block, and change the first assignment to += for consistency.
Reproduction
from markitdown.converters._rss_converter import RssConverter
import io
r = RssConverter()
xml = b'<?xml version="1.0"?><rss version="2.0"><channel></channel></rss>'
r.convert(io.BytesIO(xml), ...) # UnboundLocalError
Tests
186 existing tests pass. The fix handles: empty channel, description-only channel, title-only channel, and title+description channel.