From ecb4ea84fbdd6f0995bfbf4c0ac3a849943e3b17 Mon Sep 17 00:00:00 2001 From: Dong Nguyen Date: Thu, 24 Aug 2023 08:42:54 +0700 Subject: [PATCH] v7.0.4 Fix issue #108 - Change the order of params to use description first --- package.json | 2 +- src/utils/parseAtomFeed.js | 4 ++-- src/utils/parseRssFeed.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d414838..550a2d0 100755 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "7.0.3", + "version": "7.0.4", "name": "@extractus/feed-extractor", "description": "To read and normalize RSS/ATOM/JSON feed data", "homepage": "https://extractor-demos.pages.dev", diff --git a/src/utils/parseAtomFeed.js b/src/utils/parseAtomFeed.js index 51c0a06..7b14fe4 100644 --- a/src/utils/parseAtomFeed.js +++ b/src/utils/parseAtomFeed.js @@ -34,13 +34,13 @@ const transform = (item, options) => { } = item const pubDate = updated || modified || published || issued - const htmlContent = getText(content || summary) + const htmlContent = getText(summary || content) const entry = { id: getEntryId(id, link, pubDate), title: getText(title), link: getPureUrl(link, id, baseUrl), published: useISODateFormat ? toISODateString(pubDate) : pubDate, - description: buildDescription(htmlContent || summary, descriptionMaxLen), + description: buildDescription(summary || htmlContent, descriptionMaxLen), } const extraFields = getExtraEntryFields(item) diff --git a/src/utils/parseRssFeed.js b/src/utils/parseRssFeed.js index 9d264db..ac7892c 100644 --- a/src/utils/parseRssFeed.js +++ b/src/utils/parseRssFeed.js @@ -31,13 +31,13 @@ const transform = (item, options) => { } = item const published = useISODateFormat ? toISODateString(pubDate) : pubDate - const htmlContent = getText(content || description) + const htmlContent = getText(description || content) const entry = { id: getEntryId(guid, link, pubDate), title: getText(title), link: getPureUrl(link, guid, baseUrl), published, - description: buildDescription(htmlContent || description, descriptionMaxLen), + description: buildDescription(description || htmlContent, descriptionMaxLen), } const extraFields = getExtraEntryFields(item)