Class: ChatSDK::Messenger::FormatConverter

Inherits:
Format::Converter
  • Object
show all
Defined in:
lib/chat_sdk/messenger/format_converter.rb

Instance Method Summary collapse

Instance Method Details

#from_markdown(markdown) ⇒ Object

Markdown → Messenger (strip all formatting to plain text)



12
13
14
15
16
17
# File 'lib/chat_sdk/messenger/format_converter.rb', line 12

def from_markdown(markdown)
  text = markdown.to_s
  return "" if text.empty?

  strip_markdown(text)
end

#to_markdown(platform_text) ⇒ Object

Messenger → Markdown (pass-through, Messenger messages are plain text)



7
8
9
# File 'lib/chat_sdk/messenger/format_converter.rb', line 7

def to_markdown(platform_text)
  platform_text.to_s
end