diff options
Diffstat (limited to 'packages/astro-rss/src')
-rw-r--r-- | packages/astro-rss/src/index.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts index 35bf5f613..7764b5d13 100644 --- a/packages/astro-rss/src/index.ts +++ b/packages/astro-rss/src/index.ts @@ -142,7 +142,13 @@ async function generateRSS(rssOptions: ValidatedRSSOptions): Promise<string> { ? rssOptions.items : rssOptions.items.filter((item) => !item.draft); - const xmlOptions = { ignoreAttributes: false }; + const xmlOptions = { + ignoreAttributes: false, + // Avoid correcting self-closing tags to standard tags + // when using `customData` + // https://github.com/withastro/astro/issues/5794 + suppressEmptyNode: true, + }; const parser = new XMLParser(xmlOptions); const root: any = { '?xml': { '@_version': '1.0', '@_encoding': 'UTF-8' } }; if (typeof rssOptions.stylesheet === 'string') { |