Browse Source

标点补充

zhouna 6 years ago
parent
commit
cca4e2b371
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/utils/tools.js

+ 3 - 3
src/utils/tools.js

@@ -499,9 +499,9 @@ function filterDataArr(arrTmp){   //数据处理
       });
     });
 
-    return tmpArr.join('').replace(/^[,,.。;;、]+/,'').replace(/[,,.。;;、]+$/,function(word){
-        return word.substr(0,1);
-    });      //去掉开头的标点符号,最后的标点保留第一个
+    return tmpArr.join('').replace(config.punReg,function(word){
+      return word.substr(0,1);
+    }).replace(/^[,,.。;;、]+/,'');      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 }
 // 取消默认行为
 function preventDefault(event) {