Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1418

MarkupBuilder does not escape element content correctly if it contains EOL sequences

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.0-RC-1
    • None
    • None

    Description

      MarkupBuilder does not correctly escape element content that contains end of line characters/sequences. For example, the following:

      def b = new MarkupBuilder()
      b.element("""test
      <<
      """)

      will generate XML that looks like this:

      <element>test
      <<
      </element>

      Note that the "<<" sequence in the XML should be "<<".

      Attachments

        1. GROOVY-1418.patch
          4 kB
          Peter Ledbrook
        2. MarkupBuilderTest.groovy
          3 kB
          Peter Ledbrook

        Activity

          People

            guillaume Guillaume Sauthier
            pledbrook Peter Ledbrook
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: