diff --git a/lib/excerpt_parser.rb b/lib/excerpt_parser.rb index 24fc89792f..4a2f483f36 100644 --- a/lib/excerpt_parser.rb +++ b/lib/excerpt_parser.rb @@ -123,11 +123,6 @@ class ExcerptParser < Nokogiri::XML::SAX::Document @current_length = 0 @start_excerpt = true end - # Preserve spoilers - if attributes.include?(["class", "spoiler"]) - include_tag("span", attributes) - @in_spoiler = true - end when "details" @detail_contents = +"" if @in_details_depth == 0 diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index 11da34414c..1a9118d08c 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -589,11 +589,6 @@ describe PrettyText do expect(PrettyText.excerpt("", 100, markdown_images: true)).to eq("![car](http://cnn.com/a.gif)") end - it "should keep spoilers" do - expect(PrettyText.excerpt("
", 100)).to match_html "[image]" - expect(PrettyText.excerpt("spoiler", 100)).to match_html "spoiler" - end - it "should keep details if too long" do expect(PrettyText.excerpt("
expand

hello

", 6)).to match_html "
expand
" end