//js页面(result.data.newdata.content----html标签)
content = result.data.newdata.content.replace(/\<img/gi, '<img style="width:90%!important;height:auto;display:block;margin:0 auto" ')
.replace(/style\s*?=\s*?([‘"])[\s\S]*?\1/ig, 'style="max-width:100%;height:auto;"')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>')
//html页面
<rich-text nodes="{{content}}"></rich-text>
微信小程序自带的 富文本的解析显示
最新推荐文章于 2023-07-04 14:46:37 发布