selectBoxIt provides the html option (http://gregfranko.com/jquery.selectBoxIt.js/#Options) to specify whether the dropdown's content should be rendered as HTML or text. While this works great with option texts this has no effect on the labels of optgroups, even if the labels are already escaped in the original select element. To fix this, I'd suggest that the following line in _createUnorderedList
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/42317612-html-option-has-no-effect-on-optgroup-labels?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github).
selectBoxIt provides the html option (http://gregfranko.com/jquery.selectBoxIt.js/#Options) to specify whether the dropdown's content should be rendered as HTML or text. While this works great with option texts this has no effect on the labels of optgroups, even if the labels are already escaped in the original select element. To fix this, I'd suggest that the following line in
_createUnorderedList
optgroupElement = '<span class="selectboxit-optgroup-header ' + parent.first().attr("class") + '"data-disabled="true">' + parent.first().attr("label") + '</span>';
be changed to
optgroupElement = '<span class="selectboxit-optgroup-header ' + parent.first().attr("class") + '"data-disabled="true">' + (self.options["html"] ? parent.first().attr("label") : self.htmlEscape(parent.first().attr("label"))) + '</span>';