From 48de0cb276a4475fde3ddd30fb05f0f1a275576c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=AE=E7=84=B6?= <50158871+moshangqi@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:19:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AD=A3=E5=88=99=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E7=9A=84=E5=BC=95=E5=85=A5=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20(#226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 正则替换编辑器的引入文件 * fix: 正则替换编辑器的引入文件 --- .prettierrc.js | 3 ++- scripts/preset-editor.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index a97dd033..df37bb65 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -13,5 +13,6 @@ module.exports = { htmlWhitespaceSensitivity: 'ignore', endOfLine: 'lf', embeddedLanguageFormatting: 'auto', - bracketSpacing: true + bracketSpacing: true, + printWidth: 120 }; diff --git a/scripts/preset-editor.js b/scripts/preset-editor.js index 1a44dfd7..667309da 100644 --- a/scripts/preset-editor.js +++ b/scripts/preset-editor.js @@ -22,8 +22,12 @@ const lakeIconURL = 'https://mdn.alipayobjects.com/design_kitchencore/afts/file/ const remoteAssetsUrls = { lakejs: { src: `https://gw.alipayobjects.com/render/p/yuyan_npm/@alipay_lakex-doc/${LAKE_EDITOR_VERSION}/umd/doc.umd.js`, - after: (content) => { - return content.replace(lakeIconURL, './lake-editor-icon.js'); + after: content => { + let result = content; + result = result.replace(/https\:\/\/gw\.alipayobjects\.com[\w\/\.]+CodeMirror\.js/g, './CodeMirror.js'); + result = result.replace(/https\:\/\/gw\.alipayobjects\.com[\w\/\.]+katex\.min\.js/g, './katex.min.js'); + result = result.replace(lakeIconURL, './lake-editor-icon.js'); + return result; }, name: 'doc.umd.js', },