module MCMarkdown::Formatter::EscapeMergeTags

Constants

ALLOWED_CHARACTERS

Public Instance Methods

convert_em_tags_to_underscores(string) click to toggle source
# File lib/mc_markdown/formatters/escape_merge_tags.rb, line 15
def convert_em_tags_to_underscores string
  string.gsub( /<\/?em>/, '_' )
end
emphasis(text) click to toggle source
# File lib/mc_markdown/formatters/escape_merge_tags.rb, line 6
def emphasis text
  characters = ALLOWED_CHARACTERS.map { |char| "\\#{char}" }.join("")
  unless text.match /^\| .+ \|$/x
    "<em>#{text}</em>"
  else
    "*#{convert_em_tags_to_underscores(text)}*"
  end
end