module YARD::Templates::Helpers::HtmlHelper

def htmlify(text, markup = options.markup)

Returns:
  • (String) - the HTML

Parameters:
  • markup (Symbol) -- examples are +:markdown+, +:textile+, +:rdoc+.
  • text (String) -- the text to format
def htmlify(text, markup = options.markup)
  markup_meth = "html_markup_#{markup}"
  return text unless respond_to?(markup_meth)
  return "" unless text
  return text unless markup
  html = send(markup_meth, text).dup
  if html.respond_to?(:encode)
    html = html.force_encoding(text.encoding) # for libs that mess with encoding
    html = html.encode(:invalid => :replace, :replace => '?')
  end
  html = resolve_links(html)
  unless [:text, :none, :pre, :ruby].include?(markup)
    html = parse_codeblocks(html)
  end
  html
end