From 290b622323efc1d6bdfa6111d351120541774f28 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 14:06:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- core/src/plugins/py-editor.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/src/plugins/py-editor.js b/core/src/plugins/py-editor.js index 7e6f86ed..9583b2bb 100644 --- a/core/src/plugins/py-editor.js +++ b/core/src/plugins/py-editor.js @@ -38,7 +38,7 @@ const getRelatedScript = (target, type) => { return editor?.parentNode?.previousElementSibling; }; -async function execute({ currentTarget, script }, onBeforeRun = '') { +async function execute({ currentTarget, script }, onBeforeRun = "") { const { env, pySrc, outDiv } = this; const hasRunButton = !!currentTarget; @@ -152,7 +152,7 @@ async function execute({ currentTarget, script }, onBeforeRun = '') { console.error(str); } }; - if (onBeforeRun) onBeforeRun += ';'; + if (onBeforeRun) onBeforeRun += ";"; sync.runAsync(onBeforeRun + pySrc).then(enable, enable); }); } @@ -206,7 +206,10 @@ const makeRunButton = (handler, type) => { return; } runButton.blur(); - await handler.handleEvent(event, script?.getAttribute("onbeforerun") || ""); + await handler.handleEvent( + event, + script?.getAttribute("onbeforerun") || "", + ); }); return runButton; }; @@ -341,7 +344,11 @@ const init = async (script, type, interpreter) => { }); // avoid executing the default handler if the override returned `false` if ((await callback(event)) !== false) - await execute.call(context, { currentTarget }, onBeforeRun); + await execute.call( + context, + { currentTarget }, + onBeforeRun, + ); }; } }, @@ -419,10 +426,10 @@ const init = async (script, type, interpreter) => { const inputChild = boxDiv.querySelector(`.${type}-editor-input > div`); const parent = inputChild.attachShadow({ mode: "open" }); // avoid inheriting styles from the outer component - const styles = [':host { all: initial; }']; + const styles = [":host { all: initial; }"]; const rows = script.getAttribute("rows"); if (rows) { - const maxHeight = Math.floor(parseInt(rows) * 18.5) + 'px'; + const maxHeight = Math.floor(parseInt(rows) * 18.5) + "px"; styles.push(`.cm-editor { height: auto; max-height: ${maxHeight}; }`); } parent.innerHTML = ``;