replaceAll 重写image的行内样式,使图片自适应设备的宽高

富文本渲染,图片过宽超出设备宽度怎么办?
重写image的行内样式

.replaceAll(/(img style="(.*?)")|(class="(.*?)")|(width="(.*?)")|(height="(.*?)")/gi, 'img').replaceAll('<img','<img style="max-width:100%;height:auto;" ')

猜你喜欢

转载自blog.csdn.net/BubbleABC/article/details/130558179