diff options
author | Maciej PrzepioĢra <matthew@vaadin.com> | 2015-09-16 10:48:31 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-09-24 07:46:38 +0000 |
commit | 5c875228d9025f4c779ffc26c3eb0f7b561061e5 (patch) | |
tree | 2e3a0d230478ef7d9090db31597e440f3f1738e7 /server/src/com/vaadin/ui/OptionGroup.java | |
parent | 8006d359acce4fb31e7210ed2f20f1da3d7a1cd0 (diff) | |
download | vaadin-framework-5c875228d9025f4c779ffc26c3eb0f7b561061e5.tar.gz vaadin-framework-5c875228d9025f4c779ffc26c3eb0f7b561061e5.zip |
Support HTML entities when reading/writing declarative format #18882
Change-Id: I08099673c5dd0d688d3243e5fd169edb05f046f3
Diffstat (limited to 'server/src/com/vaadin/ui/OptionGroup.java')
-rw-r--r-- | server/src/com/vaadin/ui/OptionGroup.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/OptionGroup.java b/server/src/com/vaadin/ui/OptionGroup.java index 10c263aca0..183fc36500 100644 --- a/server/src/com/vaadin/ui/OptionGroup.java +++ b/server/src/com/vaadin/ui/OptionGroup.java @@ -33,6 +33,7 @@ import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.shared.ui.optiongroup.OptionGroupConstants; import com.vaadin.ui.declarative.DesignContext; +import com.vaadin.ui.declarative.DesignFormatter; /** * Configures select to be used as an option group. @@ -276,6 +277,14 @@ public class OptionGroup extends AbstractSelect implements if (!isItemEnabled(itemId)) { elem.attr("disabled", ""); } + if (isHtmlContentAllowed()) { + // need to unencode HTML entities. AbstractSelect.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.unencodeFromTextNode(elem.html())); + } return elem; } |