Skip to content

Update compile.js#1

Open
henryzp wants to merge 1 commit into
youngwind:masterfrom
henryzp:patch-1
Open

Update compile.js#1
henryzp wants to merge 1 commit into
youngwind:masterfrom
henryzp:patch-1

Conversation

@henryzp

@henryzp henryzp commented Oct 10, 2016

Copy link
Copy Markdown

如果是空白文本内容,如:

<div>
</div>

这样,那么不需要做一次parseText

如果是空白文本内容,如:

```
<div>
</div>
```

这样,那么不需要做一次parseText
@youngwind

Copy link
Copy Markdown
Owner

@henryzp 你说得对。不过,把这段代码

//如果是空白节点则不做处理
 +            if(/^\s+$/.test(node.nodeValue)){
 +               return;
 +            }

直接放在switch case里面,个人认为会降低代码可读性。
我觉得把他放到_compileTextNodeh函数的开头会更好些,你觉得呢?

@henryzp

henryzp commented Oct 11, 2016

Copy link
Copy Markdown
Author

@youngwind ,认同。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants