From 74caf33de3fdaeec9542d582eac5cefbfaa9d065 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 17 Sep 2024 20:04:40 +0800 Subject: [PATCH] fix: resolve issue with markdown video creation. --- .github/scripts/create-rss.mjs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/scripts/create-rss.mjs b/.github/scripts/create-rss.mjs index b0d1507..565ee48 100644 --- a/.github/scripts/create-rss.mjs +++ b/.github/scripts/create-rss.mjs @@ -107,13 +107,12 @@ const rssFilePath = `./feeds/rss/${year}-${week}.json`; rehypePlugins: [[ rehypeVideo, { details: false, test: (url) => /\.(mp4|mov)|[?&]rehype=video/i.test(url) } ]], filterPlugins:(type, plugins) => { if (type === "rehype") { - const replugins = plugins.filter((plugin) => { + return plugins.map((plugin) => { if (Array.isArray(plugin) && plugin[0].name === 'RehypeVideo') { - return false + return [rehypeVideo, { details: false, test: (url) => /\.(mp4|mov)|[?&]rehype=video/i.test(url) }]; } - return true; + return plugin; }); - return replugins } return plugins }