module Panda module CMS module EditorJs module Blocks class Quote < Base def render text = data["text"] caption = data["caption"] alignment = data["alignment"] || "left" # Build the HTML structure html = "
" \ "
#{wrap_text_in_p(text)}
" \ "#{caption_element(caption)}" \ "
" # Return raw HTML - validation will be handled by the main renderer if enabled html_safe(html) end private def wrap_text_in_p(text) # Only wrap in

if it's not already wrapped text = sanitize(text) if text.start_with?("

") && text.end_with?("

") text else "

#{text}

" end end def caption_element(caption) return "" if caption.blank? "
#{sanitize(caption)}
" end end end end end end