diff --git a/lib/excerpt_parser.rb b/lib/excerpt_parser.rb index acfa88b88..4a19c337a 100644 --- a/lib/excerpt_parser.rb +++ b/lib/excerpt_parser.rb @@ -14,7 +14,6 @@ class ExcerptParser < Nokogiri::XML::SAX::Document @markdown_images = options[:markdown_images] == true @keep_newlines = options[:keep_newlines] == true @keep_emoji_images = options[:keep_emoji_images] == true - @keep_emoji_codes = options[:keep_emoji_codes] == true @start_excerpt = false end @@ -54,7 +53,7 @@ class ExcerptParser < Nokogiri::XML::SAX::Document if attributes["class"] == 'emoji' if @keep_emoji_images return include_tag(name, attributes) - elsif @keep_emoji_codes + else return characters(attributes["alt"]) end end diff --git a/lib/onebox/engine/discourse_local_onebox.rb b/lib/onebox/engine/discourse_local_onebox.rb index 5e7564037..f0ea5a32d 100644 --- a/lib/onebox/engine/discourse_local_onebox.rb +++ b/lib/onebox/engine/discourse_local_onebox.rb @@ -66,7 +66,7 @@ module Onebox topic = post.topic slug = Slug.for(topic.title) - excerpt = post.excerpt(SiteSetting.post_onebox_maxlength, { keep_emoji_codes: true }) + excerpt = post.excerpt(SiteSetting.post_onebox_maxlength) excerpt.gsub!("\n"," ") # hack to make it render for now excerpt.gsub!("[/quote]", "[quote]") diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index 430bf7bad..729c6474c 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -263,7 +263,7 @@ HTML it "should have an option to preserve emoji codes" do emoji_code = ":heart:" - expect(PrettyText.excerpt(emoji_code, 100, { keep_emoji_codes: true })).to eq(":heart:") + expect(PrettyText.excerpt(emoji_code, 100)).to eq(":heart:") end end