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

HTML Builder changes & between URL parameters to &amp; when building an <a> tag

    XMLWordPrintableJSON

Details

    Description

      If you use a HTML builder to build an <a> tag and you have parameters in the URL the separating & is changed to a &. This is probably desirable for XML but not HTML.

      Example:

      def writer = new StringWriter()
      def builder = new groovy.xml.MarkupBuilder(writer)
      builder.a(href: "http://www.example.com?foo=1&bar=2")
      println writer.toString()
      

      This outputs <a href='http://www.example.com?foo=1&amp;bar=2' /> when it should output <a href='http://www.example.com?foo=1&bar=2' />

      I have attached a test case.

      Attachments

        1. HtmlBuilderBug.groovy
          0.3 kB
          mjparme
        2. HtmlBuilderBugTest.groovy
          0.3 kB
          mjparme

        Activity

          People

            paulk Paul King
            mjparme mjparme
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: