From d69c525cea5194ab1dc44ee017782548596e6c91 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Tue, 30 Apr 2024 10:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/mapImage.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/notion/mapImage.js b/lib/notion/mapImage.js index 1df9f911..491632bc 100644 --- a/lib/notion/mapImage.js +++ b/lib/notion/mapImage.js @@ -24,13 +24,15 @@ const mapImgUrl = (img, block, type = 'block', needCompress = true) => { } // Notion 图床转换为永久地址 - const hasConverted = ret.indexOf('https://www.notion.so/image') === 0 + const hasConverted = + ret.indexOf('https://www.notion.so/image') === 0 || + ret.includes('notion.site/images/page-cover/') // 需要转化的URL ; 识别aws图床地址,或者bookmark类型的外链图片 const needConvert = !hasConverted && - (ret.indexOf('secure.notion-static.com') > 0 || - ret.indexOf('prod-files-secure') > 0 || - block.type === 'bookmark') + (block.type === 'bookmark' || + ret.includes('secure.notion-static.com') || + ret.includes('prod-files-secure')) // 使用Notion图传 if (needConvert) {