rust-syndication / rss

Library for serializing the RSS web content syndication format
https://crates.io/crates/rss
Apache License 2.0
427 stars 52 forks source link

Parse Error #53

Closed huntiep closed 7 years ago

huntiep commented 7 years ago

I ran into an issue parsing a feed, here is a minimal example:

<rss version="2.0">
    <channel>
        <title>Example</title>
        <link>https://example.com/</link>
        <description></description>
        <item>
            <title>A & B</title>
        </item>
    </channel>
</rss>

This is the error:

Failed to parse: Xml(Error(Escape("Cannot find \';\' after \'&\'", 2..0), State { next_error: None, backtrace: None }))

This feed is parsed properly by Firefox, so it seems like an error here. Is this an issue with quick-xml?

tafia commented 7 years ago

Hmm. This should indeed be an error as per xml specs. See this SO thread: https://stackoverflow.com/questions/3493405/do-i-really-need-to-encode-as-amp

I don't know what is best: follow the specs or try to make everything work ... I tend to prefer the specs which are here for a reason.

huntiep commented 7 years ago

I'm sorry, I misunderstood what was happening in my application. This is actually the same issue as #32.

tafia commented 7 years ago

Ok I see. I'm afraid you'll need to escape it yourself for now unfortunately...