@Override protected Element writeItem(Element design, T item, DesignContext context) { Element elem = super.writeItem(design, item, context); if (!getItemEnabledProvider().test(item)) { elem.attr("disabled", true); } if (isHtmlContentAllowed()) { // need to unencode HTML entities. AbstractMultiSelect.writeDesign // can't check if HTML content is allowed, so it always encodes // entities like '>', '<' and '&'; in case HTML content is allowed // this is undesirable so we need to unencode entities. Entities // other than '<' and '>' will be taken care by Jsoup. elem.html(DesignFormatter.decodeFromTextNode(elem.html())); } return elem; }