diff options
Diffstat (limited to 'modules/ext/ui-studio.js')
| -rw-r--r-- | modules/ext/ui-studio.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/ext/ui-studio.js b/modules/ext/ui-studio.js index adda6a1..e8341f3 100644 --- a/modules/ext/ui-studio.js +++ b/modules/ext/ui-studio.js @@ -124,7 +124,8 @@ body[data-ui-mode="studio"] #ui-root { display: grid; grid-template-columns: 1.1 const target = filePath || '/notes.md'; const btn = api.el('button', { class: 'wx11-btn', text: '📝 Open the editor for ' + target }); btn.addEventListener('click', () => { - api.exec('edit ' + target); + // Quoted: a filename with a space would arrive as two arguments (found by review). + api.exec("edit '" + String(target).replace(/'/g, "'\\''") + "'"); api.toast('Editor takes over the chat pane — close it to return'); }); bodyEl.appendChild(btn); |