Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compile.js #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update compile.js #1

wants to merge 1 commit into from

Conversation

henryzp
Copy link

@henryzp henryzp commented Oct 10, 2016

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

<div>
</div>

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

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

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

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

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

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

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

@henryzp
Copy link
Author

henryzp commented Oct 11, 2016

@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