a2787ccef4b1249013fc762adc2575d80709b9f1 chmalee Thu Mar 7 10:38:09 2024 -0800 Encode the highlight parameter in hgSearch links to hgTracks because the value contains a '#' character, refs #33199 diff --git src/hg/js/hgSearch.js src/hg/js/hgSearch.js index 2a97818..097e42b 100644 --- src/hg/js/hgSearch.js +++ src/hg/js/hgSearch.js @@ -487,31 +487,31 @@ if (["all_mrna", "all_est", "xenoMrna", "xenoEst", "intronEst"].includes(title)) { hgTracksTitle = title.replace(/all_/, ""); if (searchDesc.includes("Unaligned")) goToHgTracks = false; } if (goToHgTracks) { url = "hgTracks?db=" + db + "&" + hgTracksTitle + "=pack&position=" + match.position; if (match.hgFindMatches) { url += "&hgFind.matches=" + match.hgFindMatches; } if (match.extraSel) { url += "&" + match.extraSel; } if (match.highlight) { url += url[url.length-1] !== '&' ? '&' : ''; - url += "addHighlight=" + match.highlight; + url += "addHighlight=" + encodeURIComponent(match.highlight); } } else { url = "hgc?db=" + db + "&g=" + hgcTitle + "&i=" + match.position + "&c=0&o=0&l=0&r=0" ; } matchTitle = match.posName; //if (match.canonical === true) matchTitle = "" + matchTitle + ""; } var newListObj; if (printCount < 500) { if (printCount + 1 > 10) { newListObj = "