Setting Element html content directly

Suppose that I have a markdown stored in a String (eg. "This is *Sparta*" and I have converted it to proper HTML tags, also stored in a form of a String (eg. "<p>This is <em>Sparta</em></p>". My problem is that I don’t see any easy way on how I could inject this content as actual HTML into a Div or into an Element directly.

It seems that Element.createText() escapes html tags so that the actual html code gets rendered in the end. The only way that I have seen so far is to hack around with Page.executeJavaScript(...); I wonder however, is there is any better solution to this problem?

The recommended component for this is Html.

https://vaadin.com/api/platform/11.0.3/com/vaadin/flow/component/Html.html

Tatu Lund:
The recommended component for this is Html.

https://vaadin.com/api/platform/11.0.3/com/vaadin/flow/component/Html.html

Ah, right… Thanks!