You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
content_html and content_text are each optional strings — but one or both must be present.
Note that it uses bothcontent_text and content_html, which is completely valid. An app such as iTunes, for instance, might prefer to use content_text, while a feed reader might prefer content_html.
Thus, a better methodology to parse it may be adopting the Atom approach: making entries[i].content a dict array, i.e., [{"type": "text/plain", "value": "content"}, {"type": "text/html", "value": "<p>content</p>"}].
Such a change, admittedly, would break existing downstream projects using the develop branch. Hopefully, this won't be painful, considering JSON Feed support hasn't been released yet.
I am willing to make a PR to achieve this if you think this is feasible.
The text was updated successfully, but these errors were encountered:
I think I may have caught this while working on a significant expansion of the JSON feed spec. It's in a branch on this repo already, but I haven't worked on that in a while.
I think I can incorporate this issue report in that branch and get that merged, but I don't have a timeline for getting that done.
content_text
incorrectly takes precedence overcontent_html
when parsing JSON Feed, making it impossible to getcontent_html
if both exist.feedparser/feedparser/parsers/json.py
Lines 88 to 97 in e432421
According to https://www.jsonfeed.org/version/1.1/,
content_text
andcontent_html
are completely equal.Thus, a better methodology to parse it may be adopting the Atom approach: making
entries[i].content
a dict array, i.e.,[{"type": "text/plain", "value": "content"}, {"type": "text/html", "value": "<p>content</p>"}]
.Such a change, admittedly, would break existing downstream projects using the
develop
branch. Hopefully, this won't be painful, considering JSON Feed support hasn't been released yet.I am willing to make a PR to achieve this if you think this is feasible.
The text was updated successfully, but these errors were encountered: