const formatRichText = html => {
let newContent= html.replace(/\<img/gi, '<img style="width:100%;height:auto;display:block;"').replace(/\<div style=\"/gi,'<div style="width:100%;word-break:break-all;word-wrap:normal;').replace(/\s{2,}/g,"")
return newContent
}
module.exports = {
formatRichText: formatRichText
}
noticeObjContent: util.formatRichText(params.content)Ï
小程序富文本解析样式处理
最新推荐文章于 2024-06-22 16:18:14 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)
标签以实现单词换行。它通过正则表达式调整了图片和段落的样式。
摘要由CSDN通过智能技术生成
11-29
6800
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交