From 12a75059dd52f61150daceb6ca73032046be3508 Mon Sep 17 00:00:00 2001 From: Yufan You Date: Wed, 8 Jul 2026 21:37:45 +0800 Subject: [PATCH] fix(core): make the atom format spec-compliant (#20723) * fix: remove the src attribute of atom:content The src attribute is to replace the inner content, not to mark its source. RFC4287: > 4.1.3.2. The "src" Attribute > > atom:content MAY have a "src" attribute, whose value MUST be an IRI > reference [RFC3987]. If the "src" attribute is present, atom:content > MUST be empty. Atom Processors MAY use the IRI to retrieve the > content and MAY choose to ignore remote content or to present it in a > different manner than local content. > > If the "src" attribute is present, the "type" attribute SHOULD be > provided and MUST be a MIME media type [MIMEREG], rather than "text", > "html", or "xhtml". The value is advisory; that is to say, when the > corresponding URI (mapped from an IRI, if necessary) is dereferenced, > if the server providing that content also provides a media type, the > server-provided media type is authoritative. * fix: move to xml:lang * fix: remove in atom * fix: use ISO format to display date in atom & always have * fix: use ISO date for feed in atom * fix: add for atom --- lib/views/atom.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/views/atom.tsx b/lib/views/atom.tsx index e2565bfe34..71ccabd688 100644 --- a/lib/views/atom.tsx +++ b/lib/views/atom.tsx @@ -3,15 +3,14 @@ import type { FC } from 'hono/jsx'; import type { Data } from '@/types'; const RSS: FC<{ data: Data }> = ({ data }) => ( - + {data.title || 'RSSHub'} - + + {data.id || data.link} {data.description || data.title} - Powered by RSSHub RSSHub - contact@rsshub.app (RSSHub) - {data.language || 'en'} - {data.lastBuildDate} + {new Date(data.lastBuildDate || new Date()).toISOString()} {data.author || 'RSSHub'} @@ -21,13 +20,11 @@ const RSS: FC<{ data: Data }> = ({ data }) => ( {data.item?.map((item) => ( {item.title} - - {item.description} - + {item.description} {item.guid || item.link || item.title} - {item.pubDate && {item.pubDate}} - {item.updated && {item.updated || item.pubDate}} + {item.pubDate && {new Date(item.pubDate).toISOString()}} + {new Date(item.updated || item.pubDate || new Date()).toISOString()} {item.author && ( {item.author}