Revert "DEV: Remove useless code (#10130)"

Some oneboxes still generate empty P tags (video oneboxes).

This reverts commit c299d02287.
This commit is contained in:
Dan Ungureanu 2020-06-29 12:51:16 +03:00
parent 860deeb072
commit fe284ffd06
No known key found for this signature in database
GPG Key ID: 0AA2A00D6ACC8B84

View File

@ -115,6 +115,13 @@ module Oneboxer
end end
end end
# strip empty <p> elements
doc.css("p").each do |p|
if p.children.empty? && doc.children.count > 1
p.remove
end
end
Result.new(doc, changed) Result.new(doc, changed)
end end