module YARD::Templates::Helpers::TextHelper

def h(text)

Returns:
  • (String) - escapes text
def h(text)
  out = String.new("")
  text = resolve_links(text)
  text = text.split(/\n/)
  text.each_with_index do |line, i|
    out <<
      case line
      when /^\s*$/; "\n\n"
      when /^\s+\S/, /^=/; line + "\n"
      else; line + (text[i + 1] =~ /^\s+\S/ ? "\n" : " ")
      end
  end
  out
end