Class: DaimonMarkdown::Plugin::Chat

Inherits:
Base
  • Object
show all
Defined in:
lib/daimon_markdown/plugin/chat.rb

Instance Attribute Summary

Attributes inherited from Base

#context, #doc, #node, #result

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DaimonMarkdown::Plugin::Base

Instance Method Details

#call(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/daimon_markdown/plugin/chat.rb', line 6

def call(*args)
  speaches = []
  args.each_slice(2) do |url, text|
    speaches << "    <img src=\"\#{url}\" />\n    <p>\#{text}</p>\n    SPEACH\n  end\n  html = %Q(<div class=\"chat\">\\n\#{speaches.join(\"\\n\")}\\n</div>)\n  node.parent.replace(html)\nend\n".chomp