Images On The Description Of An RSS Item

☆樱花仙子☆ 提交于 2019-12-05 00:29:08

问题


I'm starting with RSS development, for my new site, but I want to know if there is any way to put images on the description of a item, something like this:

<item>
    <title>Image Test</title>         
    <link>http://testin.test</link>
    <description>Some text...
    <img src="image.jpg"></description>
</item>

And if it's possible, which feed readers will be able to visualize it clearly and perfect.


回答1:


You can have a reference to an image inside CDATA (which is typically done). Example:

<item><title>June 13  : Cool Clear Waters</title>
<link>http://www.whitegrass.com/report.html</link>
<description>
<![CDATA[<img align="left" hspace="5" src="http://www.whitegrass.com/June 2011/IMGP9201LG.jpg"/>
 Work a little, play a little, dream into summer, celebrate a great winter gone by, keep movin'... <br />]]>
</description>
<guid isPermaLink="false">http://www.mcgurrin.com/whitegrass.xml</guid>
<pubDate>Tue, 14 Jun 2011 01:32:00 GMT</pubDate></item>

An alternative is that one reference (which may be to an image) is allowed in the enclosure tag in RSS 2.0 (see the specification for details, as additional information must be provided. More typically this is used to link to the mp3 for podcasts.



来源:https://stackoverflow.com/questions/3208873/images-on-the-description-of-an-rss-item

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!