RSS specification HTML code inside RSS feed

筅森魡賤 提交于 2021-02-17 18:40:32

问题


Is HTML code inside the <description> tag compliant in RSS 2.0?


回答1:


The RSS 2.0 specification says that you can include HTML in the description element so long as you properly encode the markup.

You have two ways to do this:

  1. Convert tags to escaped HTML entities:

    <description>this is &lt;b&gt;bold&lt;/b&gt;</description>
    
  2. Wrap the description content within a CDATA section:

    <description><![CDATA[this is <b>bold</b>]]></description>
    



回答2:


You can decode < and > char to html code

< : &lt;

> : &gt;



来源:https://stackoverflow.com/questions/9866472/rss-specification-html-code-inside-rss-feed

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