登录
/**
* 从带有 HTML 标签的字符串中,提取出纯 text 内容
* @param {String} HTML
* @returns {String}
*/
export function HTML2Text(HTML = '') {
return HTML.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi,'').replace(/<[^>]+?>/g,'').replace(/\s+/g,' ').replace(/ /g,' ').replace(/>/g,' ')
}