Class: Storyblok::Richtext::Nodes::Emoji

Inherits:
Node
  • Object
show all
Defined in:
lib/storyblok/richtext/html_renderer/nodes/emoji.rb

Instance Attribute Summary

Attributes inherited from Node

#type, #wrapper

Instance Method Summary collapse

Methods inherited from Node

#html, #initialize, #single_tag, #text

Constructor Details

This class inherits a constructor from Storyblok::Richtext::Nodes::Node

Instance Method Details

#matchingObject



5
6
7
# File 'lib/storyblok/richtext/html_renderer/nodes/emoji.rb', line 5

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

#tagObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/storyblok/richtext/html_renderer/nodes/emoji.rb', line 9

def tag
  attrs = {
    'data-type' => 'emoji',
    'data-name' => @node['attrs']['name'],
    'emoji' => @node['attrs']['emoji']
  }

  [{
    tag: "span",
    attrs: attrs
  }]
end