Is HTML code inside the <description>
tag compliant in RSS 2.0?
Asked
Active
Viewed 2.0k times
43

Thane Brimhall
- 9,256
- 7
- 36
- 50

filype
- 8,034
- 10
- 40
- 66
2 Answers
71
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:
Convert tags to escaped HTML entities:
<description>this is <b>bold</b></description>
Wrap the description content within a
CDATA
section:<description><![CDATA[this is <b>bold</b>]]></description>

random
- 9,774
- 10
- 66
- 83
3
You can decode <
and >
char to html code
<
: <
>
: >

Nguyễn Hoàng Gia
- 928
- 4
- 11
-
1You also need to change the ampersand (&) character. – Alexis Wilke Feb 05 '16 at 22:00
-
And to be safe, the `"` and `'` characters too, in addition to `&`, `<` and `>`. – Flimm Dec 28 '16 at 13:50
-
This is the complete list (5 predefined entities): https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML – Aaron Blenkush May 03 '19 at 22:52