Module: Legion::TTY::Components::MarkdownView

Defined in:
lib/legion/tty/components/markdown_view.rb

Class Method Summary collapse

Class Method Details

.render(text, width: 80) ⇒ Object



9
10
11
12
13
14
# File 'lib/legion/tty/components/markdown_view.rb', line 9

def self.render(text, width: 80)
  ::TTY::Markdown.parse(text, width: width)
rescue StandardError => e
  Legion::Logging.warn("markdown render failed: #{e.message}") if defined?(Legion::Logging)
  "#{text}\n(markdown render error: #{e.message})"
end