- Issue created by @davidhk
- First commit to issue fork.
We're experiencing this issue as well. It looks like 🐛 RSS output is no longer valid XML Fixed added the CDATA tag to the RSS view row template, but renders
description
without|raw
, which means Twig automatically encodes the HTML entities, causing the double-encoding:<![CDATA[ <p>test</p> ]]>
I've pushed a merge request that escapes any CDATA tag within
description
and then renders it using|raw
, which should be the correct approach. (This is already done a few lines later withitem.value
).This results in the expected unencoded raw HTML within the CDATA tag:
<![CDATA[ <p>test</p> ]]>
If the patch works for you as well, please update to RTBC.
- 🇳🇱Netherlands idebr
In the DisplayFeedTest.php the description is only checked for html, but not the CDATA. Can you update the assertion to include the CDATA, since this allows the inner text to be html ?
I tried but couldn't figure out a good way to do that. Since it's testing against the parsed XML, the string content of
$xml->channel->item[0]->description
doesn't contain the CDATA tag.Actually the more I think about it, I'm confused about the original intention of 🐛 RSS output is no longer valid XML Fixed . It said that the RSS output wasn't valid XHTML due to a self-closing img tag, but unless I misunderstand something (I'm not an RSS spec expert) the actual content of
<description>
doesn't need to be valid XHTML, it's just character data.The spec states either CDATA or escaped markup is suitable.
It seems like reverting to just
<description>{{ description }}</description>
would be the cleanest fix, unless there's something I'm missing. That would produce a valid description field with escaped HTML:<description><p>A paragraph</p></description>