class DaimonMarkdown::Plugin::Chat

Public Instance Methods

call(*args) click to toggle source
# File lib/daimon_markdown/plugin/chat.rb, line 6
      def call(*args)
        speaches = []
        args.each_slice(2) do |url, text|
          speaches << <<~SPEACH.chomp
          <img src="#{url}" />
          <p>#{text}</p>
          SPEACH
        end
        html = %Q(<div class="chat">\n#{speaches.join("\n")}\n</div>)
        node.parent.replace(html)
      end