let escape2Html=(str)=>{
var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) { return arrEntities[t]; }).replace(/<img/gi, '<img style="max-width:100%;height:auto;" ');
}
过滤后端返回的html文本标签
猜你喜欢
转载自www.cnblogs.com/fanqiuzhuji/p/12516088.html
今日推荐
周排行