From ec5479a9eeeb2f45c459fa0d15a84eedacc5e6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=BF=BC?= Date: Mon, 10 Oct 2016 16:10:48 +0800 Subject: [PATCH] Update compile.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果是空白文本内容,如: ```
``` 这样,那么不需要做一次parseText --- src/instance/compile.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/instance/compile.js b/src/instance/compile.js index a87daa3..d7b60d4 100644 --- a/src/instance/compile.js +++ b/src/instance/compile.js @@ -85,6 +85,10 @@ exports._compileNode = function (node) { break; // node case 3 : + //如果是空白节点则不做处理 + if(/^\s+$/.test(node.nodeValue)){ + return; + } this._compileTextNode(node); break; default: