function getPlainTxt(html) {
var DEFAULT_VERSION = 8.0;
var ua = navigator.userAgent.toLowerCase();
var isIE = ua.indexOf("msie") > -1;
var safariVersion;
if (isIE) {
safariVersion = ua.match(/msie ([\d.]+)/)[1];
}
if (safariVersion <= DEFAULT_VERSION) {
html = html.replace(/[\n\r]/g, ''); //ie要先去了\n在处理
html = html.replace(/<([a-zA-Z1-6]+)(\s*[^>]*)?>/g, "<$1>");
html = html.replace(/<(?!\/?P|\/?BR)[^<>]*>/ig, '');
html = $.trim(html, "g");
html = html.replace(/(<P>| |<pre>|<\/pre>)/g, "");
html = html.replace(/(<\/P>|<BR>)/g, "\n");
html = html.replace(/\//g,"");
html = html.replace(/\s/g,"");
} else {
html = html.replace(/<([a-zA-Z1-6]+)(\s*[^>]*)?>/g, "<$1>");
html = html.replace(/<(?!\/?p|\/?br)[^<>]*>/ig, '');
html = $.trim(html, "g");
html = html.replace(/(<p>| |<pre>|<\/pre>)/g, "");
html = html.replace(/(<\/p>|<br>)/g, "\n");
html = html.replace(/\//g,"");
html = html.replace(/\s/g,"");
}
return html;
}