-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for dc:creator
#131
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like this?
- Adds the schema for dc, if creator is used.
- Allow multiple creators.
- Do author or creator, not both (as one best practice suggests).
entry.author.map((author: Author) => { | ||
item["dc:creator"] = { _cdata: author.name }; | ||
if (author.email && author.name) { | ||
item.author.push({ _text: author.email + " (" + author.name + ")" }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entry.author.map((author: Author) => { | |
item["dc:creator"] = { _cdata: author.name }; | |
if (author.email && author.name) { | |
item.author.push({ _text: author.email + " (" + author.name + ")" }); | |
} | |
item["dc:creator"] = []; | |
entry.author.map((author: Author) => { | |
if (author.email && author.name) { | |
item.author.push({ _text: author.email + " (" + author.name + ")" }); | |
} else if (author.name) { | |
isDublinCore = true; | |
item["dc:creator"].push({ _cdata: author.name }); | |
} |
And up above:
let isDublinCore = false;
And down below:
if (isDublinCore) {
base.rss._attributes["xmlns:dc"] = "http://purl.org/dc/elements/1.1/";
}
ebe9963
to
fd77835
Compare
This should not be added to the RSS2 spec, as by definition, it is not in the RSS2 spec (https://validator.w3.org/feed/docs/rss2.html) |
Are you referring to the spec file modified by this pull request? That's a test file. "spec" in the filename does not mean it has anything to do with the RSS2 spec, it's just a Jest convention. If you're saying this node module shouldn't use extra namespaces, consider this from the document you link:
(Emphasis mine.) Nobody is saying that the Dublin core namespace is part of the RSS2 spec. The RSS2 spec over time has proven to have problems and be incomplete, which is why new namespaces -- which have schemas apart from the RSS2 schema -- have added missing functionality. Dublin core is such a namespace. It is popular and well-supported by readers. |
Closes #130