Single quotes (') and refined search bug

Refined search has a nice feature where you can remove single entries from active search by clicking on the (x) close button that will appear on the left of an entry, on mouse over.

The bug is that if an entry has a single quote (’), the (x) button will not work.

E.g.

FIELD1
(x) ACME Items
(x) XYZ Item’s

The (x) button to the left of “ACME Items” will work, i.e. it will remove it form the search.
The (x) button to the left of “XYZ Items” will NOT work: clicking on it nothing happens.

Unfortunately single or double quotes breaking SC code is common in many parts of SC…