Commit 5cfde18d01fb46aa14a7e51c69368047c6300b0e

Authored by yvan.ni
1 parent 17d2216c

img src 为空的优化

Showing 1 changed file with 2 additions and 0 deletions
utils/wxParse/html2json.js
... ... @@ -54,6 +54,8 @@ module.exports = {
54 54 e;
55 55 }, {})), "img" === s.tag) {
56 56 s.imgIndex = i.images.length;
  57 + if(!s.attr) return false;
  58 + if(!s.attr.src) return false;
57 59 var d = s.attr.src;
58 60 "" == d[0] && d.splice(0, 1), d = l.urlToHttpUrl(d, n), s.attr.src = d, s.from = a,
59 61 i.images.push(s), i.imageUrls.push(d);
... ...