What is the correct syntax for using HTML builder with mixed content in Groovy 1.7?

Posted by stian on Stack Overflow See other posts from Stack Overflow or by stian
Published on 2010-03-20T12:08:02Z Indexed on 2010/03/20 12:11 UTC
Read the original article Hit count: 386

Filed under:
|

On the Groovy example page there is an example of how to use Groovy HTML builder with mixed content:

p [
        "This is some",
        b"mixed",
        "text. For more see the",
        ahref:'http://groovy.codehaus.org' ["Groovy"],
        "project"
  ]

This is however not working for me, I get an error message like:

expecting ']', found 'mixed' @ line 33, column 23. b"mixed", ^ 1 error 

The Groovy example page states that:

[Note: the syntax in some of these examples is slightly out-dated. See chapter 8 of GINA in the mean-time until these examples are updated.]

My suspicion therefore is that the syntax of the HTML builder has changed, however I don't have the book so I cannot check and I cannot seem to find any relevant example of this working online. Does anyone know how the syntax is supposed to be in Groovy 1.7 and have got this working?

© Stack Overflow or respective owner

Related posts about groovy

Related posts about html