class Diffy::HtmlFormatter

def split_characters(chunk)

def split_characters(chunk)
  chunk.gsub(/^./, '').each_line.map do |line|
    chars = line.sub(/([\r\n]$)/, '').split('')
    # add escaped newlines
    chars << '\n'
    chars.map{|chr| ERB::Util.h(chr) }
  end.flatten.join("\n") + "\n"
end