From de677a3a1be941c9a5db7db302fb0ead427f8735 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 15:33:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixun_lists/index.json.jbuilder | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/shixun_lists/index.json.jbuilder b/app/views/shixun_lists/index.json.jbuilder index 400e6fb8e..c925d6876 100644 --- a/app/views/shixun_lists/index.json.jbuilder +++ b/app/views/shixun_lists/index.json.jbuilder @@ -9,11 +9,11 @@ json.shixun_list do reg = /^[,。?:;‘’!“”—……、]/ # 附件的替换 atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ - highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '') - highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '') + highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') + highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') json.title highlights.delete(:name)&.join('...') || obj.searchable_title - json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300].sub!(atta_reg, '') + json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '') json.content highlights json.level level_to_s(obj.trainee)