Make replace_html_entities behave in Ruby 1.8.7 the same way it does in Ruby 1.9