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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment