FIX: nofollow was being added during post processing when it shouldn't

This commit is contained in:
Robin Ward
2016-08-12 15:28:54 -04:00
parent 7427209f21
commit aef954784a
3 changed files with 32 additions and 1 deletions

View File

@ -7,6 +7,8 @@ require_dependency 'pretty_text'
class CookedPostProcessor
include ActionView::Helpers::NumberHelper
attr_reader :cooking_options
def initialize(post, opts={})
@dirty = false
@opts = opts
@ -17,6 +19,7 @@ class CookedPostProcessor
@cooking_options = post.cooking_options || opts[:cooking_options] || {}
@cooking_options[:topic_id] = post.topic_id
@cooking_options = @cooking_options.symbolize_keys
@cooking_options[:omit_nofollow] = true if post.omit_nofollow?
analyzer = post.post_analyzer
@doc = Nokogiri::HTML::fragment(analyzer.cook(post.raw, @cooking_options))