Choices icon indicating copy to clipboard operation
Choices copied to clipboard

Wrong handling of ampersand in option text

Open jprusch opened this issue 1 year ago • 1 comments

Ampersand is HTML-escaped without need ( & -> & amp;)

To Reproduce Create a single select like:

<select name="search" class="choiceselect">
    <option value="1234">K&K</option>									
</select>

Check the rendered list. It displays as K& amp;K

Remark: I intentionally added a space after & to get this rendered correctly in github.

Generated HTML is:

<div id="choices--search-x1-item-choice-1" class="choices__item choices__item--choice choices__item--selectable is-highlighted"
   role="option" data-choice="" data-id="1" data-value="1234" data-select-text="" 
   data-choice-selectable="" aria-selected="true">K&amp;K</div>

Expected behavior The select option displays: K&K

All browser & platforms affected (Windows /Chrome&Edge, iOS Safari)

image

jprusch avatar Dec 04 '23 10:12 jprusch

I'm seeing this issue as well.

Tridus avatar Feb 20 '24 15:02 Tridus

allowHTML: true

lucaspedreira avatar Apr 08 '24 17:04 lucaspedreira

Thx, solved the issue

jprusch avatar Apr 09 '24 06:04 jprusch