I know that I can use $.html to set the HTML content of something, and $.text to set the content (and that this escapes the HTML).
Unfortun
You're appending an element which already has content? Or you're adding the content after you append? Either way, you still need to do .text(...) on that element.
If you're using append and passing HTML as the argument, then try creating the element first, and passing it to append.
Ex:
$('').text('your content here').appendTo('div#someid')