module MarkdownUI::Renderers::BlockQuote

Public Instance Methods

block_quote(text) click to toggle source
# File lib/markdown-ui/renderers/block_quote.rb, line 4
def block_quote(text)
  element, content = text.split(':')
  @params          = element.split

  @elements = Hash.new(MarkdownUI::Content::BasicBlock).merge(
      button:    MarkdownUI::Button::Element,
      segment:   MarkdownUI::Segment,
      grid:      MarkdownUI::Grid::Grid,
      row:       MarkdownUI::Grid::Row,
      column:    MarkdownUI::Grid::Column,
      container: MarkdownUI::Container::Element,
      buttons:   MarkdownUI::Button::Group::Buttons::Element,
      label:     MarkdownUI::Label::Element,
      span:      MarkdownUI::Content::SpanBlock,
      content:   MarkdownUI::Content::ContentBlock,
      divider:   MarkdownUI::Content::DividerBlock,
      field:     MarkdownUI::Content::FieldBlock,
      fields:    MarkdownUI::Content::FieldsBlock,
      form:      MarkdownUI::Content::FormBlock,
      item:      MarkdownUI::Content::ItemBlock,
      tag:       MarkdownUI::Tag,
      menu:      MarkdownUI::Menu::Element,
      message:   MarkdownUI::Message::Element,
      input:     MarkdownUI::Content::InputBlock,
      header:    MarkdownUI::Content::HeaderBlock
  )

  html { @elements[key].new(element, content).render } if content
end

Protected Instance Methods

key() click to toggle source
# File lib/markdown-ui/renderers/block_quote.rb, line 40
def key
  keys.grep(regexp).first
end
keys() click to toggle source
# File lib/markdown-ui/renderers/block_quote.rb, line 44
def keys
  @elements.keys
end
regexp() click to toggle source
# File lib/markdown-ui/renderers/block_quote.rb, line 36
def regexp
  Regexp.new (@params.collect { |u| u.downcase }).join('|'), "i"
end