Open 58bcbedf47bd91439c opened 6 years ago
TypeError: Cannot read property 'style' of undefined
at Object.start (html2json.js? [sm]:169)
at parseStartTag (htmlparser.js? [sm]:154)
at RegExp.[Symbol.replace] (
我也遇到了这个问题,是由于被解析的 html 字符串中出现了 <font>
标签,但是该标签并没有任何属性导致的。
解决方案:
找到 /wxParse/html2json.js,这个文件中有这样一段代码:
// 处理font标签样式属性
if (node.tag === 'font' ) {
// 省略
}
将上面代码修改为:
// 处理font标签样式属性
if (node.tag === 'font' && node.attr) {
// 省略
}
问题就解决了。
可以了,非常感谢
页面在解析的时候出现的,内容是后台提供的,有个别内容会出现这个问题,求告知原因