mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 01:57:15 +08:00
FEATURE: Nokogumbo (#9577)
* FEATURE: Nokogumbo Use Nokogumbo HTML parser.
This commit is contained in:

committed by
GitHub

parent
b8b1cbbfb9
commit
9bff0882c3
@ -13,7 +13,7 @@ module UserNotificationsHelper
|
||||
end
|
||||
|
||||
def correct_top_margin(html, desired)
|
||||
fragment = Nokogiri::HTML.fragment(html)
|
||||
fragment = Nokogiri::HTML5.fragment(html)
|
||||
if para = fragment.css("p:first").first
|
||||
para["style"] = "margin-top: #{desired};"
|
||||
end
|
||||
@ -32,7 +32,7 @@ module UserNotificationsHelper
|
||||
end
|
||||
|
||||
def first_paragraphs_from(html)
|
||||
doc = Nokogiri::HTML(html)
|
||||
doc = Nokogiri::HTML5(html)
|
||||
|
||||
result = +""
|
||||
length = 0
|
||||
|
Reference in New Issue
Block a user