biostar-central icon indicating copy to clipboard operation
biostar-central copied to clipboard

Search + click on highlighted tag searches by HTML instead of by tag content

Open RamRS opened this issue 2 years ago • 0 comments

This happens both at https://www.biostars.org/ and https://support.bioconductor.org/

Steps to reproduce:

  1. Search for a term that can appear in/as tags: https://www.biostars.org/post/search/?query=TCGA
  2. Click on a tag that has a yellow highlight: screenshot
  3. Generates a weird tag query (https://www.biostars.org/tag/%3Cb%20class=%22match%20term0%22%3ETCGA%3C/b%3E/).

This happens because while a non-highlighted tag has the HTML content <a class="ptag" href="/tag/barcode/">barcode</a>, a highlighted tag has the content <a class="ptag" href="/tag/%3Cb%20class=%22match%20term0%22%3ETCGA%3C/b%3E/"><b class="match term0">TCGA</b></a> or the not so clean <a class="ptag" href="/tag/<b class="match term0">TCGA</b>/"><b class="match term0">TCGA</b></a>. It looks like the part that sets the innerHTML for the tag also sets the link in one go.

RamRS avatar Oct 20 '22 21:10 RamRS