FIX: Use absolute URLs in search shortcut (#14585)

FIX: Use absolute URLs in search shortcut (#14585)

diff --git a/app/assets/javascripts/discourse/app/widgets/search-menu.js b/app/assets/javascripts/discourse/app/widgets/search-menu.js
index b62a4ae..47dc787 100644
--- a/app/assets/javascripts/discourse/app/widgets/search-menu.js
+++ b/app/assets/javascripts/discourse/app/widgets/search-menu.js
@@ -299,7 +299,7 @@ export default createWidget("search-menu", {
 
           this.appEvents.trigger(
             "composer:insert-text",
-            document.activeElement.getAttribute("href"),
+            document.activeElement.href,
             {
               ensureSpace: true,
             }
diff --git a/app/assets/javascripts/discourse/tests/acceptance/search-test.js b/app/assets/javascripts/discourse/tests/acceptance/search-test.js
index 47ec79c..912c949 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/search-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/search-test.js
@@ -350,7 +350,7 @@ acceptance("Search - Authenticated", function (needs) {
 
     assert.equal(
       query("#reply-control textarea").value,
-      firstLink,
+      `${window.location.origin}${firstLink}`,
       "hitting A when focused on a search result copies link to composer"
     );
   });

GitHub sha: 308823a253dc58346041c2497082fb58f1f481e2

This commit appears in #14585 which was approved by techAPJ. It was merged by techAPJ.

This commit has been mentioned on Discourse Meta. There might be relevant details there: