mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
Revert "DEV: Remove useless code (#10130)"
Some oneboxes still generate empty P tags (video oneboxes).
This reverts commit c299d02287
.
This commit is contained in:
parent
860deeb072
commit
fe284ffd06
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user