REVERT: FIX: handle clicks counters in quotes

REVERT: FIX: handle clicks counters in quotes

Not quite a full revert of 7696b92c8cd4de631133b27fa52c1f18fc66774b that isn’t actually required.

diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rb
index 1182818..a8d38ea 100644
--- a/lib/cooked_post_processor.rb
+++ b/lib/cooked_post_processor.rb
@@ -97,12 +97,7 @@ class CookedPostProcessor
 
     return if previous.blank?
 
-    # remove click counters
-    previous_doc = Nokogiri::HTML::fragment(previous)
-    previous_doc.css("span.clicks").remove
-
-    previous_text = previous_doc.text.strip
-
+    previous_text = Nokogiri::HTML::fragment(previous).text.strip
     quoted_text = @doc.css("aside.quote:first-child blockquote").first&.text&.strip || ""
 
     return if previous_text.gsub(/(\s){2,}/, '\1') != quoted_text.gsub(/(\s){2,}/, '\1')
diff --git a/spec/components/cooked_post_processor_spec.rb b/spec/components/cooked_post_processor_spec.rb
index c2962e4..0df302a 100644
--- a/spec/components/cooked_post_processor_spec.rb
+++ b/spec/components/cooked_post_processor_spec.rb
@@ -1368,23 +1368,6 @@ describe CookedPostProcessor do
       expect(reply.raw).to eq("and this is the third reply")
     end
 
-    it "works with click counters" do
-      post = Fabricate(:post,
-        topic: topic,
-        raw: "[Discourse](https://www.discourse.org) is amazing!",
-        cooked: %{<p><a href="https://www.discourse.org">Discourse <span class="badge badge-notification clicks" title="1 click">1</span></a> is amazing!</p>}
-      )
-
-      reply = Fabricate(:post,
-        topic: topic,
-        raw: "[quote]\n[Discourse](https://www.discourse.org) is amazing!\n[/quote]\nIt sure is :+1:"
-      )
-
-      CookedPostProcessor.new(reply).remove_full_quote_on_direct_reply
-
-      expect(reply.raw).to eq("It sure is :+1:")
-    end
-
   end
 
 end

GitHub sha: 9756e359

2 Likes