- def cook(raw, opts = {})
- # For some posts, for example those imported via RSS, we support raw HTML. In that
- # case we can skip the rendering pipeline.
- return raw if cook_method == Post.cook_methods[:raw_html]
-
- options = opts.dup
- options[:cook_method] = cook_method
-
- post_user = self.user
- options[:user_id] = post_user.id if post_user
-
- if add_nofollow?
- cooked = post_analyzer.cook(raw, options)
- else
- # At trust level 3, we don't apply nofollow to links
- options[:omit_nofollow] = true
- cooked = post_analyzer.cook(raw, options)
- end
-
- new_cooked = Plugin::Filter.apply(:after_post_cook, self, cooked)
-
- if post_type == Post.types[:regular]
- if new_cooked != cooked && new_cooked.blank?
- Rails.logger.debug("Plugin is blanking out post: #{self.url}\nraw: #{raw}")
- elsif new_cooked.blank?
- Rails.logger.debug("Blank post detected post: #{self.url}\nraw: #{raw}")
- end
- end
-
- new_cooked
- end