Sha256: 085e2c9144d0559a9ba24ffab0f682206a8a03c336b97dc82cc2726d45c1f16c

Contents?: true

Size: 729 Bytes

Versions: 5

Compression:

Stored size: 729 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'test_helper')

class RexmlBugs < ActiveSupport::TestCase
  def test_that_some_illegal_chars_are_parsed_without_complaint
    p "REXML ignores illegal ']]>' brackets in xml content"
    assert_nothing_raised do
      # The right angle bracket (>) may be represented using the string "&gt;", and MUST, for compatibility,
      # be escaped using either "&gt;" or a character reference when it appears in the string "]]>" in content,
      # when that string is not marking the end of a CDATA section.
      # - http://www.w3.org/TR/xml11/#syntax
      xml = "<title>The Big Book of ]]> everything more</title>"
      assert_equal xml, REXML::Document.new(xml).to_s
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
Empact-roxml-2.5.2 test/bugs/rexml_bugs.rb
Empact-roxml-2.5.3 test/bugs/rexml_bugs.rb
doxo-roxml-2.5.3 test/bugs/rexml_bugs.rb
roxml-2.5.2 test/bugs/rexml_bugs.rb
roxml-2.5.3 test/bugs/rexml_bugs.rb