Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.8.6
-
Component/s: XML Processing
-
Testcase included:yes
-
Number of attachments :
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&bar=2' /> when it should output <a href='http://www.example.com?foo=1&bar=2' />
I have attached a test case.
Please note that the actual output I tried to show didn't display correctly because Jira changed the & to an & inside the description. The test case will show the problem though