bue icon indicating copy to clipboard operation
bue copied to clipboard

Update compile.js

Open henryzp opened this issue 9 years ago • 2 comments

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

<div>
</div>

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

henryzp avatar Oct 10 '16 08:10 henryzp

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

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

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

youngwind avatar Oct 10 '16 09:10 youngwind

@youngwind ,认同。。。

henryzp avatar Oct 11 '16 01:10 henryzp