I've worked on a solution for this ticket. From what I could see, right clicking and "Open in a new tab" the facet option is one use case of facets (this allows to keep the current results and quickly select a few different facets independently). In regards to this use case, it's important to keep the anchors. So instead of changing their nature (which was the solution I thought would be appropriate and that I described in the ticket topic), I decided to duplicate their content in an invisible label. Anchors can't be used as labels for input elements, there's no way for us to have this double role without duplication. And as far as I know, it seems okay to duplicate the content in anchor, because it's relatively simple. The 'heaviest' thing in the anchor's content would be a small profile picture of the user.
AFAIK any other solution to create a label would either:
- ask for a lot of translations
- Be really complex: filtering out some kind of element and parsing the part we want from the others.
The structure of the anchor's content will never be too complex and never user generated, so I think it's okay to keep this imperfect implementation. If we deem the cost of duplication is too high for this solution to work, I think we should consider removing the "Search in another tab" use case mentioned above.
Started PR here: https://github.com/xwiki/xwiki-platform/pull/2187