From 84042a28bd128434c11568f302a5edbf711dff9a Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Tue, 28 Jun 2022 16:07:30 +0200 Subject: [PATCH] fix: Issues in newsletter script --- scripts/newsletter-lib.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/newsletter-lib.mjs b/scripts/newsletter-lib.mjs index dccdae4045a..097a90e60df 100644 --- a/scripts/newsletter-lib.mjs +++ b/scripts/newsletter-lib.mjs @@ -18,9 +18,9 @@ const cwd = path.dirname(fileURLToPath(import.meta.url)) const backend = "https://backend.freesewing.org/" const asHtml = async (text) => { - let content = await unified().use(markdown).use(remark2rehype).use(format).use(html).process(text) + const content = await unified().use(markdown).use(remark2rehype).use(format).use(html).process(text) - return content.contents + return content.value } const getToken = async () => { @@ -51,7 +51,7 @@ const send = async (test = true) => { console.log(err) process.exit() } - const text = edition.body + const text = edition.data[0].body const subscribers = await getSubscribers(test) const content = await asHtml(text)