Class: RuboCop::Cop::Discourse::NoNokogiriHtmlFragment
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Discourse::NoNokogiriHtmlFragment
- Defined in:
- lib/rubocop/cop/discourse/no_nokogiri_html_fragment.rb
Overview
Do not use Nokogiri::HTML.fragment Instead use Nokogiri::HTML5.fragment, which is using Nokogumbo parser
Constant Summary collapse
- MSG =
"Nokogiri::HTML.fragment is deprecated and should not be used."
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
24 25 26 27 |
# File 'lib/rubocop/cop/discourse/no_nokogiri_html_fragment.rb', line 24 def on_send(node) return if !using_nokogiri_html_fragment?(node) add_offense(node, message: MSG) end |