function formatStr(str) { str = str.replace(/ /g, " "); str = str.replace(/<br>/g, " "); return str }替换就可以了,好简单的