FEATURE: Nokogumbo (#9577)

* FEATURE: Nokogumbo

Use Nokogumbo HTML parser.
This commit is contained in:
Krzysztof Kotlarek
2020-05-05 13:46:57 +10:00
committed by GitHub
parent b8b1cbbfb9
commit 9bff0882c3
50 changed files with 165 additions and 179 deletions

View File

@ -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