From 5b070b6acc664177fd8b57569108c829a36481c4 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Jul 2016 16:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8=E7=9A=84ht?= =?UTF-8?q?ml=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 3 ++- app/views/users/_user_message_userfeedaback.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1306d5625..fa0a60eea 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3289,7 +3289,7 @@ def strip_html(text,len=0,endss="...") ss = "" if !text.nil? && text.length>0 ss=text.gsub(/<\/?.*?>/, '').strip - ss = ss.gsub(/ /, ' ') + ss = ss.gsub(/ */, ' ') if len > 0 && ss.length > len ss = ss[0, len] + endss @@ -3303,6 +3303,7 @@ end def message_content content content = (strip_html content).strip + content = content.gsub(/\s+/, " ") if content.gsub(" ", "") == "" content = "[非文本消息]" end diff --git a/app/views/users/_user_message_userfeedaback.html.erb b/app/views/users/_user_message_userfeedaback.html.erb index bfdbeb9f3..666fa37a3 100644 --- a/app/views/users/_user_message_userfeedaback.html.erb +++ b/app/views/users/_user_message_userfeedaback.html.erb @@ -9,7 +9,7 @@ "><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %>
  • - <%= link_to ma.journals_for_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, feedback_path(ma.journals_for_message.jour_id, :anchor => "user_activity_#{ma.journals_for_message.id}"), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank'%> + <%= link_to message_content(ma.journals_for_message.notes), feedback_path(ma.journals_for_message.jour_id, :anchor => "user_activity_#{ma.journals_for_message.id}"), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank'%>