Choices-js/Choices

Wrong handling of ampersand in option text

Closed this issue · 3 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

I'm seeing this issue as well.

allowHTML: true

Thx, solved the issue