-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Description
Some Atom feeds only define their language via the root <feed> element using the xml:lang attribute.
It would be great if it were possible to access this value as a fallback in cases where there is no <language> or <dc:language> element provided in the feed.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it-IT">
...Workaround:
I have been able to work around this by specifying the following configuration:
const parser = new Parser({
customFields: {
feed: [['$', 'feedRoot', { keepArray: true }]]
}
});
const parsedFeed = await parser.parseString(feedXML);
const fallbackLanguage = parsedFeed.feedRoot?.['xml:lang'];The fact this works seems accidental rather than intentional, so I'd prefer a more official solution.
Metadata
Metadata
Assignees
Labels
No labels