zendframework / zend-form

Form component from Zend Framework
BSD 3-Clause "New" or "Revised" License
69 stars 87 forks source link

Impossible to disable escaping of select option labels #183

Open netbrothers-tr opened 6 years ago

netbrothers-tr commented 6 years ago

At this point it seems to be impossible to disable HTML escaping of select option labels. Here is an entry point into the code for the current HEAD in the master branch. There's no difference to the develop branch at this point.

Why is the possibility to disable HTML escaping important, you might ask? It has become quiet common to use unicode emojis and other non alphanumerical characters in the web. This counts also for select option labels. Theoretically it's possible to include these characters directly into the labels without using entities but the problem is that this is often impractical.

In my case I have a dynamic set of FontAwesome icons that I want to include in my option labels. I can assign the FontAwesome font via CSS to the select element and then include the unicode characters in the label, e.g. . Using the FontAwesome font this becomes a retweet icon.

But it would be so much easier just to be able to use the unicode entities as in this post on StackOverflow (link to solution).

Any pros and cons are welcome!

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-form; a new issue has been opened at https://github.com/laminas/laminas-form/issues/8.