feed icon indicating copy to clipboard operation
feed copied to clipboard

Fallback to description when content is not provided for JSON feed

Open JosephDuffy opened this issue 4 years ago • 0 comments

In RSS 2 the description may contain the full text and the content can be omitted when there is not a short version available: https://cyber.harvard.edu/rss/rss.html#hrelementsOfLtitemgt

However a JSON feed will not contain a content_html field when the content is not provided.

This makes it hard to create both a JSON feed and an RSS 2 feed because providing content without a description will create a content:encoded field but not a description field in the RSS 2 feed.

My solution to this is to fallback to the item.description when item.content is not provided and generating a JSON feed.

JosephDuffy avatar Jul 29 '21 19:07 JosephDuffy