Method: EditorJs::Blocks::QuoteBlock#render

Defined in:
lib/editor_js/blocks/quote_block.rb

#render(_options = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/editor_js/blocks/quote_block.rb', line 21

def render(_options = {})
  text = data['text'].html_safe
  caption = data['caption'].presence&.html_safe

   :div, class: css_name do
    html_str =  :div, text, class: "#{css_name}__text"
    html_str << (:div, caption, class: "#{css_name}__caption") if caption
    html_str
  end
end