From 613bfbc6e8d492852cd2d9fd4842dadeb6bb4a77 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 11 Dec 2024 17:44:00 -0400 Subject: client: sidebar-search: split 2+ dashes in single-word drop --- src/static/js/client/sidebar-search.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/static/js') diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js index b7b0b8f0..9d2cae34 100644 --- a/src/static/js/client/sidebar-search.js +++ b/src/static/js/client/sidebar-search.js @@ -963,6 +963,16 @@ async function handleDroppedIntoSearchInput(domEvent) { droppedText = matchedLink.innerText; } + if (droppedText.includes('-')) splitDashes: { + if (droppedURL) break splitDashes; + if (droppedText.includes(' ')) break splitDashes; + + const parts = droppedText.split('-'); + if (parts.length === 2) break splitDashes; + + droppedText = parts.join(' '); + } + info.searchInput.value = droppedText; activateSidebarSearch(info.searchInput.value); } -- cgit 1.3.0-6-gf8a5