Images in RSS feed

后端 未结 6 1310
北海茫月
北海茫月 2020-12-30 22:23

Whenever I see images in an RSS feed, they are embedded in CDATA, rather than surrounded by tags.

In my feed, I would like the images to show up without doing that.<

6条回答
  •  不思量自难忘°
    2020-12-30 22:52

    For completeness: In RSS 2.0, you CAN have a single enclosure inside an item, which per the spec. can be for a single image. However I understand that support among feed aggregators varies. More typically this is used for things like podcasts. The RSS 2.0 standard states:

     is an optional sub-element of . 
    

    It has three required attributes. url says where the enclosure is located, length says how big it is in bytes, and type says what its type is, a standard MIME type. The url must be an http url.

    Note that you must include the size of the item, along with the URL and mime type.

    However, as others indicated, including the picture(s) in CDATA is much more common.

提交回复
热议问题