Browse Source

解决空白行被过滤的问题

cnspray 5 years ago
parent
commit
c8a8b584c4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      static/word2md/turndown.js

+ 2 - 1
static/word2md/turndown.js

@@ -599,8 +599,9 @@ function Node (node) {
 }
 
 function isBlank (node) {
+	//如果要忽略掉空白的表,请删除'TABLE','THEAD','TBODY','TR'
   return (
-    ['A', 'TH', 'TD', 'IFRAME', 'SCRIPT', 'AUDIO', 'VIDEO'].indexOf(node.nodeName) === -1 &&
+    ['A', 'TABLE','THEAD','TBODY','TR','TH', 'TD', 'IFRAME', 'SCRIPT', 'AUDIO', 'VIDEO'].indexOf(node.nodeName) === -1 &&
     /^\s*$/i.test(node.textContent) &&
     !isVoid(node) &&
     !hasVoid(node)