Class: Panda::Editor::Blocks::Quote

Inherits:
Base
  • Object
show all
Defined in:
lib/panda/editor/blocks/quote.rb

Instance Attribute Summary

Attributes inherited from Base

#data, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Panda::Editor::Blocks::Base

Instance Method Details

#renderObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/panda/editor/blocks/quote.rb', line 7

def render
  text = data['text']
  caption = data['caption']
  alignment = data['alignment'] || 'left'

  # Build the HTML structure
  html = "<figure class=\"text-#{alignment}\">" \
    "<blockquote>#{wrap_text_in_p(text)}</blockquote>" \
    "#{caption_element(caption)}" \
    '</figure>'

  # Return raw HTML - validation will be handled by the main renderer if enabled
  html_safe(html)
end