From 980cd93f5448f6fad97f33899ff07ae45d4e4b06 Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Fri, 17 Jul 2026 17:25:42 +0900 Subject: [PATCH] fix: also support data-mt-command attribute for set-editor command --- mt-static/plugins/MTBlockEditor/src/loader_entry.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mt-static/plugins/MTBlockEditor/src/loader_entry.ts b/mt-static/plugins/MTBlockEditor/src/loader_entry.ts index 00a226d..4248f9f 100644 --- a/mt-static/plugins/MTBlockEditor/src/loader_entry.ts +++ b/mt-static/plugins/MTBlockEditor/src/loader_entry.ts @@ -60,10 +60,12 @@ async function initSelectElms(selectElms: NodeListOf): Promis inputElm.value = target.value; target.closest(".mt-editor-manager-wrap")?.appendChild(wrap); + const editorId = target.id.replace(/.*-/, ""); const fieldName = ( document.querySelector( - `#editor-header .tab[mt\\:command="set-editor-${target.id.replace(/.*-/, "")}"] a` + `#editor-header .tab[mt\\:command="set-editor-${editorId}"] a` + + `, #editor-header .tab[data-mt-command="set-editor-${editorId}"] a` ) as HTMLElement ).textContent || ""; const opts: ApplyOptions = {