Sha256: 34ee884a70eb75583caa8a2d108ae360289d7519282b2bf7c085bbcef477b4c1

Contents?: true

Size: 340 Bytes

Versions: 4

Compression:

Stored size: 340 Bytes

Contents

module Storyblok::Richtext
  module Marks
    class Highlight < Mark

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

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