wxParse-微信小程序富文本解析自定义组件,支持HTML及markdown解析
Home Page:http://weappdev.com/
Geek Repo:Geek Repo
Github PK Tool:Github PK Tool
volsifly opened this issue 5 years ago · comments
html2json.js里
var imgUrl = node.attr.src; if (imgUrl[0] == '') { imgUrl.splice(0, 1); }
如果标签里没有src属性,imgUrl会为空,找不到0的数据报错了,需要加个判断
是的,我也遇到过这个问题了;改成var imgUrl = node.attr.src || []即可。