Sha256: 4d44e3fca376b59549cf072222f11a42c316116a1f1f9a3ebb11bb2a2e3faaa2
Contents?: true
Size: 475 Bytes
Versions: 72
Compression:
Stored size: 475 Bytes
Contents
class Pulitzer::UpdateContentElement def initialize(content_element, params) @content_element, @params = content_element, params.dup end def call text_editor = Pulitzer.text_editor_toolbars.detect { |toolbar| toolbar[:name] == content_element.text_editor } if 'Kramdown' == text_editor[:kind] params[:markdown] = params[:body] params[:body] = Kramdown::Document.new(params[:body]).to_html end @content_element.update params end end
Version data entries
72 entries across 72 versions & 1 rubygems