Sha256: 637c8800e25e2c221b49e58a47975274044245cc17168f272d2f2bf222542822

Contents?: true

Size: 599 Bytes

Versions: 24

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

module Maglev
  module Content
    class Text < Base
      # rubocop:disable Rails/OutputSafety
      def tag(view_context, options = {})
        view_context.tag.public_send(
          options.delete(:html_tag)&.to_sym || tag_name,
          to_s.html_safe,
          **{
            data: (options.delete(:data) || {}).merge(tag_data)
          }.merge(options)
        )
      end
      # rubocop:enable Rails/OutputSafety

      private

      def tag_name
        setting.options[:html] && !setting.options[:line_break] ? :div : :span
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
maglevcms-1.7.3 app/components/maglev/content/text.rb
maglevcms-1.7.2 app/components/maglev/content/text.rb
maglevcms-1.7.1 app/components/maglev/content/text.rb
maglevcms-1.7.0 app/components/maglev/content/text.rb
maglevcms-1.6.1 app/components/maglev/content/text.rb
maglevcms-1.6.0 app/components/maglev/content/text.rb
maglevcms-1.5.1 app/components/maglev/content/text.rb
maglevcms-1.4.0 app/components/maglev/content/text.rb
maglevcms-1.3.0 app/components/maglev/content/text.rb
maglevcms-1.2.2 app/components/maglev/content/text.rb
maglevcms-1.2.1 app/components/maglev/content/text.rb
maglevcms-1.2.0 app/components/maglev/content/text.rb
maglevcms-1.1.7 app/components/maglev/content/text.rb
maglevcms-1.1.6 app/components/maglev/content/text.rb
maglevcms-1.1.5 app/components/maglev/content/text.rb
maglevcms-1.1.4 app/components/maglev/content/text.rb
maglevcms-1.1.3 app/components/maglev/content/text.rb
maglevcms-1.1.2 app/components/maglev/content/text.rb
maglevcms-1.1.1 app/components/maglev/content/text.rb
maglevcms-1.1.0 app/components/maglev/content/text.rb