wxParse无法解析html

0次阅读

共计 328 个字符,预计需要花费 1 分钟才能阅读完成。

第一步错误代码:

<span style="color:red;font-family:" serif",tahoma,verdana,helvetica;font-size:12px;font-style:normal;font-weight:400;text-decoration:none;"=""sans="">XXXX</span>

一直以为是多个双引号引起的 bug。最终发现是 font-family 后面多了个空格导致的。

第二步找到 wxParse.js 文件, 把 style 后有空格的去掉,问题就解决

var arr1 = data.split('style=')
var ping = arr1[0] + "style=" + arr1[1].replace(/\s/g, "") ;
正文完
 0