Method: YARD::Templates::Helpers::HtmlHelper#html_markup_markdown

Defined in:
lib/yard/templates/helpers/html_helper.rb

#html_markup_markdown(text) ⇒ String

Converts Markdown to HTML

Parameters:

  • text (String)

    input Markdown text

Returns:

Since:

  • 0.6.0

[View source]

57
58
59
60
61
62
63
64
65
66
67
# File 'lib/yard/templates/helpers/html_helper.rb', line 57

def html_markup_markdown(text)
  # TODO: other libraries might be more complex
  provider = markup_class(:markdown)
  if provider.to_s == 'RDiscount'
    provider.new(text, :autolink).to_html
  elsif provider.to_s == 'RedcarpetCompat'
    provider.new(text, :gh_blockcode, :fenced_code, :autolink).to_html
  else
    provider.new(text).to_html
  end
end