Irritating REXML bug in Ruby 1.8.6

June 27th, 2007 by Hen

If you’re using Ruby 1.8.6, try the following:

irb
require 'rexml/document'
REXML::Document.new("<foo x='&amp;'/>").to_s

In 1.8.5 I get an answer of "<foo x='&amp;'/>", in 1.8.6 it is "<foo x='&amp;amp;'/>, ie) entities are doubly escaped when they shouldn’t be.

One Response to “Irritating REXML bug in Ruby 1.8.6”

  1. Odi Says:

    Looks like REXML lacks a test suite.