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( = {}) text = data['text'].html_safe caption = data['caption'].presence&.html_safe content_tag :div, class: css_name do html_str = content_tag :div, text, class: "#{css_name}__text" html_str << content_tag(:div, caption, class: "#{css_name}__caption") if caption html_str end end |