mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: blank cooked markdown could raise an exception in logs
Previously if somehow a user created a blank markdown document using tag tricks (eg `<p></p><p></p><p></p><p></p><p></p><p></p>`) and so on, we would completely strip the document down to blank on post process due to onebox hack. Needs a followup cause I am still unclear about the reason for empty p stripping and it can cause some unclear cases when we re-cook posts.
This commit is contained in:
@@ -23,7 +23,8 @@ class CookedPostProcessor
|
||||
@cooking_options[:topic_id] = post.topic_id
|
||||
@cooking_options = @cooking_options.symbolize_keys
|
||||
|
||||
@doc = Nokogiri::HTML::fragment(post.cook(post.raw, @cooking_options))
|
||||
cooked = post.cook(post.raw, @cooking_options)
|
||||
@doc = Nokogiri::HTML::fragment(cooked)
|
||||
@has_oneboxes = post.post_analyzer.found_oneboxes?
|
||||
@size_cache = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user