jsumners / jsumners/feedparser
When <summary> follows <content>, summary_detail is not set
Open
Nobody has claimed this yet.
auto-migrated
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
This shows up in current HEAD and in 5.1.3.
The two trivial Atom 1.0 feeds attached are the same, except that the order of
the <content> and <summary> elements is swapped.
When <summary> comes first, I get the result I would expect: feedparser returns
<summary> in 'summary' and 'summary_detail', and <content> in 'content'.
When <content> comes first, however, feedparser puts <content> into 'summary',
puts both <content> and <summary> into 'content', and doesn't set
'summary_detail' at all...
Looking at the code, this is because _start_summary looks to see if the current
entry already has a 'summary' field set (which it does, because _end_content
set it), and if so, saves the summary into 'content'. I'm not sure why that's a
useful thing to do, but there are a couple of tests that make sure it does it
(wellformed/rss/item_summary_and_description.xml and
wellformed/rss/item_description_and_summary.xml) -- is there a historical
reason for wanting this behaviour with the nonstandard <summary> element in
RSS? (And if so, can it be disabled for Atom?)
Original issue reported on code.google.com by ats-goog...@offog.org on 31 Jul 2013 at 3:25
Attachments:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading _start_summary and _end_content, then compare the attached summary-then-content.atom and content-then-summary.atom feeds. Run wellformed/rss/item_summary_and_description.xml and wellformed/rss/item_description_and_summary.xml to understand the existing expectations; done means Atom content followed by summary sets summary and summary_detail correctly without breaking the RSS tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100