htmlToText(html) {
try {
return html.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi, '').replace(/<[^>]+?>/g, '').replace(/\s+/g, ' ').replace(/ /g, ' ')
.replace(/>/g, ' ');
} catch (e) {
return '';
}
},
实现html转文本
最新推荐文章于 2024-06-13 10:09:08 发布