解决办法:
var allData ='sadfsad<img alt="" src="./emoji/new_0.gif"
width="16" height="16" align="absmiddle"> <br/>
asdf asf <img alt="" src="./emoji/new_28.gif"
width="16" height="16" align="absmiddle"> sdf dsfasdf';
allData = allData.replace(/\<([\s\S]*?)\>/g, function(match) {
return match.replace(/ /g, " ")
});