Closed le0pard closed 11 months ago
Is this still an issue in 2.x?
@matthewp yes, it is. Tested @astrojs/rss
version 2.1.0
No CDATA
, just escaped all tags
Will look into it
This seems to be intentionally disallowed by https://github.com/withastro/astro/pull/5550.
Is there a way to add the custom data you want without undoing protections introduced by that PR?
Yep, will be cool, if will be option to escape only ]]>
(need split on 2 CDATA), if it happen in content instead all html tags. But I figured myself how to fight with this (form xml myself). So I will close for now.
This seems to still be an issue with 4.0.7. Can you clarify what your workaround was exactly?
@JaneSmith as I wrote previously - I am stop using "@astrojs/rss" and just form rss myself
// src/pages/rss.xml.js
export const GET = async () => {
const result = generateRssToString()
return new Response(result, {
headers: {
'Content-Type': 'application/xml'
}
});
}
What version of
astro
are you using?1.7.2
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
yarn
What operating system are you using?
Mac
Describe the Bug
Problem reproduced on @astrojs/rss >= 1.1.0.
@astrojs/rss till version 1.1.0 use
CDATA
to safely define any content indescription
tag. But started from 1.1.0 it just using encode all tags, if they present in XML tags. This lead, that in rss content was readable as valid HTML withCDATA
, now it just show in some RSS readers as encoded HTML content. Added screenshotsAny tags inside
customData
withCDATA
converted to encoded data withoutCDATA
inside. Example:Converted to result on screenshot
Current solution is to use 1.0.3 and do not upgrade @astrojs/rss.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-jgvjth?file=src/pages/rss.xml.js
Participation