Considering I want to create this HTML dynamically:
<li><img src="a"/>some text</li>
Some text is a text string that is potentially unsafe, let's say is stored in variable 'some_text'.
The idea is to call $('<li>').append($('<img>').attr({src:"a"}), ... );
Using $(some_text) is bad idea because it's unsafe.
Using text(some_text) doesn't work because the text is not an only child of an element.
I do not want to wrap the text into a <span>
I do not want to invent/use a function that sanitizes or escapes the string
text())