How to convert my HTML to SafeHtml in GWT

how can i change my Html to SafeHtml

Html htmlText = new Html();
htmlText.setText(result.getText());

      

I am saving the summary in my htmlText, but I want to save it as SafeHtml

how can i convert the above html to safehtml?

thank

+3


source to share


1 answer


Take a look at com.google.gwt.safehtml.shared.SafeHtmlUtils

, this class provides utilities to generate SafeHtml, the easiest way to solve your problem is to use



SafeHtml safeHtml = SafeHtmlUtils.fromString(result.getText());

      

+5


source







All Articles