Вы можете использовать эту функцию, чтобы скрыть HTML (украденный из исходного кода Prototype):
function unescapeHTML(html) {
return html
.replace(/</g,'<')
.replace(/>/g,'>')
.replace(/&/g,'&');
}
Затем вы можете использовать возможность синтаксического анализа jQuery, чтобы получить текст из тегов:
for(var x=0;x<contentArray.length;x++){
var $el = $(unescapeHTML(contentArray[x+1])).find('li'); //use the unescaped HTML to construct a jQuery object and find the li tag within it
markup += '<td>' + $el.text() + '</td>'; // get the text from the jQuery object and insert it into the fragment
x++;
}