Revert "FIX: don't blow up trying to replace spoiler with post url when post is"

Revert “FIX: don’t blow up trying to replace spoiler with post url when post is”

This reverts commit a1ce55b78437473fda5308249e9fd3ff4a67f061.

diff --git a/plugin.rb b/plugin.rb
index 98fdc82..db2f124 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -15,10 +15,6 @@ after_initialize do
 
   on(:reduce_cooked) do |fragment, post|
     fragment.css(".spoiler").each do |el|
-      if !post
-        el.inner_html = I18n.t("spoiler_alert.excerpt_spoiler")
-        next
-      end
       link = fragment.document.create_element("a")
       link["href"] = post.url
       link.content = I18n.t("spoiler_alert.excerpt_spoiler")
diff --git a/spec/pretty_text_spec.rb b/spec/pretty_text_spec.rb
index a20fc9e..37babd4 100644
--- a/spec/pretty_text_spec.rb
+++ b/spec/pretty_text_spec.rb
@@ -31,12 +31,4 @@ describe PrettyText do
 
     expect(md).to eq(html)
   end
-
-  it 'doesn\'t blow up when post is nil' do
-    md = PrettyText.cook('I like watching [spoiler]my tests fail[/spoiler]')
-    md = PrettyText.format_for_email(md, nil)
-    html = "<p>I like watching <span class=\"spoiler\">spoiler</span></p>"
-
-    expect(md).to eq(html)
-  end
 end

GitHub sha: 052ebf6c