From 82779c99ea1bac9339f0703850675e3eb2c9faf5 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 26 Aug 2016 09:59:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E6=97=B6=EF=BC=8C=E7=A9=BA=E6=A0=BC=E4=B8=8D?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 2 +- public/javascripts/wechat/others/factory.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 504fea3cb..0b2e807e6 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1453,7 +1453,7 @@ function description_showwords_ellipsis(id,num){ }); //去掉空格 - str = str.replace(/\s/gi,''); + str = str.replace(/[\f\n\r\t\v]/gi,''); if(str.length > num){ str = str.substring(0,num)+"..."; diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js index 1c40c9c10..6d887282b 100644 --- a/public/javascripts/wechat/others/factory.js +++ b/public/javascripts/wechat/others/factory.js @@ -247,11 +247,11 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc var desc = "" if(response.data.data.content){ - desc = response.data.data.content.replace(/<[^>]+>/g,"").replace(/\s*/g,"").replace(/ /g,""); + desc = response.data.data.content.replace(/<[^>]+>/gi,"").replace(/[\f\n\r\t\v]/gi,"").replace(/ /gi,""); } if(response.data.data.description){ - desc = response.data.data.description.replace(/<[^>]+>/g,"").replace(/\s*/g,"").replace(/ /g,""); + desc = response.data.data.description.replace(/<[^>]+>/gi,"").replace(/[\f\n\r\t\v]/gi,"").replace(/ /gi,""); } if(desc.length > 30){