From 2920cfc3195e094cf95f8399525260a8554e0679 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 10 Nov 2014 21:07:43 +1100 Subject: [PATCH] fix excerpt code --- lib/flag_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flag_query.rb b/lib/flag_query.rb index 3949ddd7090..2fe90c1c195 100644 --- a/lib/flag_query.rb +++ b/lib/flag_query.rb @@ -133,7 +133,7 @@ module FlagQuery excerpt = Post.excerpt(cooked, 200) # remove the first link if it's the first node fragment = Nokogiri::HTML.fragment(excerpt) - if fragment.children.first == fragment.css("a:first").first + if fragment.children.first == fragment.css("a:first").first && fragment.children.first fragment.children.first.remove end fragment.to_html.strip