mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:41:03 +08:00
FIX: timing issue with edits and cook post processing
This commit is contained in:
@ -11,7 +11,11 @@ class CookedPostProcessor
|
||||
@opts = opts
|
||||
@post = post
|
||||
@previous_cooked = (@post.cooked || "").dup
|
||||
@doc = Nokogiri::HTML::fragment(post.cooked)
|
||||
# NOTE: we re-cook the post here in order to prevent timing issues with edits
|
||||
# cf. https://meta.discourse.org/t/edit-of-rebaked-post-doesnt-show-in-html-only-in-raw/33815/6
|
||||
cooking_options = post.cooking_options || opts[:cooking_options] || {}
|
||||
cooking_options[:topic_id] = post.topic_id
|
||||
@doc = Nokogiri::HTML::fragment(post.cook(post.raw, cooking_options.symbolize_keys))
|
||||
@size_cache = {}
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user