Method: Plain::AiDocs.convert_markdown

Defined in:
app/services/plain/ai_docs.rb

.convert_markdown(text) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
# File 'app/services/plain/ai_docs.rb', line 112

def self.convert_markdown(text)
  # rndr = Markdownray.new(filter_html: true, hard_wrap: true)
  options = {
    fenced_code_blocks: true,
    no_intra_emphasis: true,
    autolink: true,
    lax_html_blocks: true
  }
  markdown_to_html = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options)
  # markdown_to_html = Redcarpet::Markdown.new(rndr, options)
  markdown_to_html.render(text) #rescue nil
end