Use SafeHtmlUtils.fromTrustedString(), where you explicitly say that you 
trust the argument string to be "safe" HTML: no validation or sanitization 
will be done. Have a look at HtmlSanitizer and SimpleHtmlSanitizer if you 
don't trust the input.

On Tuesday, December 4, 2012 4:07:14 PM UTC+1, Fille wrote:
>
> How can I display this text "Hello<br>World" as:
>
> Hello
> World
>
> in CellList using UiRenderer
>
> I have this Cell displaying news items:
>
> public class NewsItemCell extends AbstractCell<NewsWrapper> {
>> interface NewsItemRenderer extends UiRenderer {
>> void render(SafeHtmlBuilder sb, NewsWrapper news);
>> }
>> private static NewsItemRenderer renderer = 
>> GWT.create(NewsItemRenderer.class);
>> @Override
>
> public void render(Context context, NewsWrapper value, SafeHtmlBuilder sb) 
>> {
>> if (value == null) {
>> return;
>> }
>>
>> renderer.render(sb,  value); 
>> }
>> }
>
>
> To display the text I tried:
> <ui:safehtml from='{news.getContentSafeHtml}' />
> <ui:text from='{news.getContent}' />
>
> Where News#getContentSafeHtml() is: SafeHtmlUtils.fromString(content); I 
> have tried many variations on this.
>
> The resulting text displayed is: Hello<br>World
>
> Any ideas how to display formatted html?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/wDtTQLYhF7EJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to