Sha256: 35bef27d55c8ef36e4ff59f481a40f2484bd854a7167fcab5acd2c88f5841917

Contents?: true

Size: 447 Bytes

Versions: 21

Compression:

Stored size: 447 Bytes

Contents

require 'nokogiri'

module CopyTunerClient
  module I18nCompat
    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

    module_function :select_html_incompatible_blurbs
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
copy_tuner_client-0.19.0 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.18.0 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.17.1 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.16.3 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.16.2 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.16.1 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.16.0 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.15.1 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.15.0 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.14.2 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.14.1 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.14.0 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.13.6 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.13.5 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.13.3 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.13.2 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.13.1 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.13.0 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.12.0 lib/copy_tuner_client/i18n_compat.rb
copy_tuner_client-0.11.0 lib/copy_tuner_client/i18n_compat.rb