Sha256: 77686c2cb527658ad0958b6561c5edb5d860582833c18fbf1a584e40c4943313

Contents?: true

Size: 340 Bytes

Versions: 3

Compression:

Stored size: 340 Bytes

Contents

module Storyblok::Richtext
  module Marks
    class TextStyle < Mark

      def matching
        @node['type'] === 'textStyle'
      end

      def tag
        attrs = {
          style: "background-color:#{@node['attrs']['color']};"
        }
        [{
          tag: "span",
          attrs: attrs
        }]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
storyblok-richtext-renderer-0.0.9 lib/storyblok/richtext/html_renderer/marks/text_style.rb
storyblok-richtext-renderer-0.0.8 lib/storyblok/richtext/html_renderer/marks/text_style.rb
storyblok-richtext-renderer-0.0.7 lib/storyblok/richtext/html_renderer/marks/text_style.rb