mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: embedding topics would fail with some HTML
When truncating content we try to search for first paragraph, if HTML had no P it would fallback to first div which may have nested elements.
This commit is contained in:
@@ -227,7 +227,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||
return result unless result.blank?
|
||||
|
||||
# If there is no first paragaph, return the first div (onebox)
|
||||
doc.css('div').first
|
||||
doc.css('div').first.to_s
|
||||
end
|
||||
|
||||
def self.expanded_for(post)
|
||||
|
||||
Reference in New Issue
Block a user