class SlackTransformer::Slack::Blockquote

Constants

PATTERN

Attributes

input[R]

Public Class Methods

new(input) click to toggle source
# File lib/slack_transformer/slack/blockquote.rb, line 28
def initialize(input)
  @input = input
end

Public Instance Methods

to_html() click to toggle source
# File lib/slack_transformer/slack/blockquote.rb, line 32
def to_html
  input.gsub(PATTERN) do
    outer = Regexp.last_match(1)
    inner = Regexp.last_match(2).gsub("\n", '<br>')

    "#{outer}<blockquote>#{inner}</blockquote>#{outer}"
  end
end