Module: CopyTunerClient::I18nCompat

Defined in:
lib/copy_tuner_client/i18n_compat.rb

Class Method Summary collapse

Class Method Details

.select_html_incompatible_blurbs(blurbs) ⇒ Object



5
6
7
8
9
10
# File 'lib/copy_tuner_client/i18n_compat.rb', line 5

def select_html_incompatible_blurbs(blurbs)
  non_html_key_blurbs = blurbs.reject { |key| key.ends_with?('.html') || key.ends_with?('_html') }
  html_blurbs = non_html_key_blurbs.select do |key, content|
    Nokogiri::HTML.fragment(content).children.any? { |node| node.name != 'text' }
  end
end