From 0d7cab6dd05b63442404abdfd9ad2a2f4a647dd8 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 10 Oct 2021 17:05:05 +0100 Subject: [PATCH] Feed parser: Check for empty descriptions too --- src/index.11tydata.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.11tydata.js b/src/index.11tydata.js index 4e988b4..827dac0 100644 --- a/src/index.11tydata.js +++ b/src/index.11tydata.js @@ -48,8 +48,9 @@ module.exports = async function() { item.content = item.content.text; } - if(!item.description) item.description = striptags(item.content) - .substr(0, DESCRIPTION_LENGTH); + if(!item.description + || (typeof item.description == "string" && item.description.length === 0)) item.description = striptags(item.content) + .substr(0, DESCRIPTION_LENGTH); if(!item.pubdate) item.pubdate = item.published || item.updated