From 976faa1ba81ee3f70df2141cb74832d22501bdfc Mon Sep 17 00:00:00 2001 From: moguno Date: Wed, 17 May 2017 23:09:47 +0900 Subject: [PATCH] =?UTF-8?q?:description=E3=82=92=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=82=82to=5Fshow()=E3=81=AE=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=81=8C=E5=A4=89=E3=82=8F=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/retriever/mixin/message_mixin.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/lib/retriever/mixin/message_mixin.rb b/core/lib/retriever/mixin/message_mixin.rb index c18601ef..9233741f 100644 --- a/core/lib/retriever/mixin/message_mixin.rb +++ b/core/lib/retriever/mixin/message_mixin.rb @@ -129,7 +129,12 @@ module Retriever::Model::MessageMixin end def to_show - @to_show ||= description.gsub(/&(gt|lt|quot|amp);/){|m| {'gt' => '>', 'lt' => '<', 'quot' => '"', 'amp' => '&'}[$1] }.freeze + if @prev_description != description + @prev_description = description + @to_show = description.gsub(/&(gt|lt|quot|amp);/){|m| {'gt' => '>', 'lt' => '<', 'quot' => '"', 'amp' => '&'}[$1] }.freeze + end + + @to_show end def to_message -- 2.11.0 (Apple Git-81)