Sha256: f3f78c9e5aa713feee875c0fa1be7a51717a28b40eb829838d6348300065db52

Contents?: true

Size: 343 Bytes

Versions: 13

Compression:

Stored size: 343 Bytes

Contents

class FormattedDiv < Hyperloop::Component
  param :markdown, type: String
  collect_other_params_as :attributes

  def render
    div(params.attributes) do # send other attributes on to the outer div
      div(
        dangerously_set_inner_HTML:
          { __html: `marked(#{params.markdown}, {sanitize: true })` }
      )
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hyper-operation-0.5.12 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.11 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.10 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.9 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.8 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.7 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.6 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.5 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.4 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.3 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.2 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.1 examples/chat-app/app/hyperloop/components/formatted_div.rb
hyper-operation-0.5.0 examples/chat-app/app/hyperloop/components/formatted_div.rb