fix: select extended types before content (#733)

This commit is contained in:
connor trotter 2023-03-15 11:56:30 -04:00 committed by GitHub
parent 2dd3ce6045
commit e8ba7ece29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,6 +223,10 @@ const RootExtractor = {
content,
};
}
let extendedResults = {};
if (extractor.extend) {
extendedResults = selectExtendedTypes(extractor.extend, opts);
}
const title = extractResult({ ...opts, type: 'title' });
const date_published = extractResult({ ...opts, type: 'date_published' });
const author = extractResult({ ...opts, type: 'author' });
@ -247,11 +251,6 @@ const RootExtractor = {
type: 'url_and_domain',
}) || { url: null, domain: null };
let extendedResults = {};
if (extractor.extend) {
extendedResults = selectExtendedTypes(extractor.extend, opts);
}
return {
title,
content,