Skip to content

Commit

Permalink
Merge pull request #157 from issaTan/master
Browse files Browse the repository at this point in the history
fixed 图片大小不正确 & fixed result is not defined
  • Loading branch information
icindy committed Aug 23, 2017
2 parents 956eb4b + fa2f8b3 commit e70c6a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wxParse/html2json.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function removeDOCTYPE(html) {

function trimHtml(html) {
return html
.replace(/\n+/g, '')
.replace(/\r?\n+/g, '')
.replace(/<!--.*?-->/ig, '')
.replace(/\/\*.*?\*\//ig, '')
.replace(/[ ]+</ig, '<')
Expand Down Expand Up @@ -205,7 +205,7 @@ function html2json(html, bindName) {
//当有缓存source资源时于于video补上src资源
if(node.tag === 'video' && results.source){
node.attr.src = results.source;
delete result.source;
delete results.source;
}

if (bufArray.length === 0) {
Expand All @@ -227,6 +227,8 @@ function html2json(html, bindName) {
};

if (bufArray.length === 0) {
node.index = index.toString()
index += 1
results.nodes.push(node);
} else {
var parent = bufArray[0];
Expand Down

0 comments on commit e70c6a8

Please sign in to comment.