module Kramdown::Utils::HTML

def entity_to_str(e)

Convert the +entity+ to a string.
def entity_to_str(e)
  if RUBY_VERSION >= '1.9' && (c = e.char.encode(@doc.parse_infos[:encoding]) rescue nil) && !ESCAPE_MAP.has_key?(c)
    c
  elsif @doc.options[:numeric_entities] || e.name.nil?
    "&##{e.code_point};"
  else
    "&#{e.name};"
  end
end