68bc2fb0b79a074d3a0050db46bcb8b46a11600d
hiram
  Mon Mar 23 09:31:49 2026 -0700
fix by claude, strip html highlighting markup when populating the input box with the text selections refs there is some RM but I can not find that

diff --git src/hg/js/autocompleteCat.js src/hg/js/autocompleteCat.js
index 39a6c6e08f8..bcee769fa43 100644
--- src/hg/js/autocompleteCat.js
+++ src/hg/js/autocompleteCat.js
@@ -192,30 +192,36 @@
                         return;
                     }
                 } else if (request.term.length >=2) {
                     let results = cache[request.term];
                     if (results) {
                         acCallback(results);
                     } else if (options.baseUrl) {
                         doSearch(request.term, acCallback);
                     }
                 }
             };
 
             var autoCompleteSelect = function(event, ui) {
                 // This is a callback for autocomplete to let us know that the user selected
                 // a term from the list.  See http://api.jqueryui.com/autocomplete/#event-select
+                // Strip any HTML tags from item.value before jQuery UI uses it to populate the
+                // input box.  item.value can contain HTML when jQuery UI's _normalize falls back to
+                // setting value = label (which contains <b> markup for bolding matched text).
+                if (ui.item.value) {
+                    ui.item.value = ui.item.value.replace(/<[^>]*>/g, '');
+                }
                 // since we are in an autocomplete don't bother saving the
                 // prefix the user typed in, just keep the geneSymbol itself
                 if (this.id === "positionInput") {
                     let key = typeof(ui.item.geneSymbol) !== 'undefined' ? ui.item.geneSymbol : ui.item.value;
                     addRecentSearch(getDb(), key, ui.item);
                 }
                 // Save genome selection for species search bars, but only if item has a definite db.
                 // Taxa-only selections (like "Human" without a specific db) are handled by the
                 // CGI's response handler after the actual db is determined.
                 if (options.showRecentGenomes && ui.item.db && !ui.item.disabled) {
                     if (ui.item.originalCategory) {
                         ui.item.category = ui.item.originalCategory;
                     }
                     addRecentGenome(ui.item);
                 }