47

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

2 Answers 2

75

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>
    
Sign up to request clarification or add additional context in comments.

Comments

4

You can decode < and > char to html code

< : &lt;

> : &gt;

3 Comments

You also need to change the ampersand (&) character.
And to be safe, the " and ' characters too, in addition to &, < and >.
This is the complete list (5 predefined entities): en.wikipedia.org/wiki/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.