From 1da4ec12707a41064b1128afe2c30ab061e6a290 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 26 Feb 2021 01:52:16 -0500 Subject: [PATCH] ace: Simplify the `aceEditorCSS` hook map function --- src/static/js/ace.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index ba1429a9d..1f3593096 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -165,12 +165,8 @@ const Ace2Editor = function () { const includedCSS = [ '../static/css/iframe_editor.css', `../static/css/pad.css?v=${clientVars.randomVersionString}`, - ...hooks.callAll('aceEditorCSS').map((path) => { - if (path.match(/\/\//)) { // Allow urls to external CSS - http(s):// and //some/path.css - return path; - } - return `../static/plugins/${path}`; - }), + // Allow urls to external CSS - http(s):// and //some/path.css + ...hooks.callAll('aceEditorCSS').map((p) => /\/\//.test(p) ? p : `../static/plugins/${p}`), `../static/skins/${clientVars.skinName}/pad.css?v=${clientVars.randomVersionString}`, ];