# Post with CDATA block produces invalid RSS feed?

**URL:** <https://meta.discourse.org/t/post-with-cdata-block-produces-invalid-rss-feed/53362>\
**Category:** Product Support\
**Created:** [25.Ноябрь.2016 12:32:23 UTC](https://meta.discourse.org/t/post-with-cdata-block-produces-invalid-rss-feed/53362 "2016-11-25T12:32:23Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [27.Ноябрь.2016 07:36:31 UTC](https://meta.discourse.org/t/post-with-cdata-block-produces-invalid-rss-feed/53362/9 "2016-11-27T07:36:31Z")

</div>

> [@iamntz](#):
>
> It’s a bug?

I wouldn’t call it a bug, but more an edge case.

> [@mpalmer](#):
>
> Is nested CDATA valid?

No

> **[2.7 CDATA Sections - Extensible Markup Language (XML) 1.0 (Fifth Edition)](https://www.w3.org/TR/REC-xml/#sec-cdata-sect)**
>
> \[Definition: CDATA sections may occur anywhere character data may occur; they are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string " \<!\[CDATA\[ " and end with the...

> Within a CDATA section, only the CDEnd string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using “`&lt;`” and “`&amp;`”. CDATA sections cannot nest.

> [@iamntz](#):
>
> what can I do about this?

The problem is, after the first `<![CDATA[` everything up to the `]]>` is considered to be “character data” and not XML tags. Once a `]]>` is encountered, it goes back to needing to be well-formed valid XML.

My first thought was to change the \< and / or ] to an entity. But after seeing the “and cannot” I guess that won’t work.

Maybe “breaking” the inner CDEnd by inserting zwsp characters would work?

> **[ZERO WIDTH SPACE (ZWSP) (U+200B)](https://www.fileformat.info/info/unicode/char/200B/index.htm)**
>
> Get the complete details on Unicode character U+200B on FileFormat.Info

EDIT

The RSS for this topic is valid and uses entities (`&lt; and &gt;`), so it looks like my first thought should work.

> **[Feed Validator Results:...](https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fmeta.discourse.org%2Ft%2Fpost-with-cdata-block-produces-invalid-rss-feed%2F53362.rss)**

---

_[View the full topic](https://meta.discourse.org/t/post-with-cdata-block-produces-invalid-rss-feed/53362)._
