From 7ff73753c856ef489500b90f3aeb39b44a2935a9 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 24 Nov 2021 22:41:18 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20`/unsplash=20search=20te?= =?UTF-8?q?rm`=20not=20including=20all=20words?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - card definitions allow multiple params split by spaces in /menu commands but that meant for search terms that included spaces only the first word was being captured - updated the param handling so the last param specified includes all remaining words in the slash command --- .../koenig-editor/addon/components/koenig-slash-menu.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-slash-menu.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-slash-menu.js index bd906acc4b..82ad8665a3 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-slash-menu.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-slash-menu.js @@ -201,9 +201,16 @@ export default class KoenigSlashMenuComponent extends Component { let payload = Object.assign({}, item.payload); // params are order-dependent and listed in CARD_MENU for each card + // last param will include all remaining text including spaces if (!isEmpty(item.params) && !isEmpty(params)) { item.params.forEach((param, i) => { - payload[param] = params[i]; + let value = params[i]; + + if (i === item.params.length - 1) { + value = params.slice(i).join(' '); + } + + payload[param] = value; }); }