We have an image stored in the database as u.avatar and an image on disk as /images/default.png.

When using output(u.avatar) it creates an <img src=''> tag with single quotes. While using image("/images/default.png") outputs an <img src=""> tag with double quotes. It would be nice if WebDSL is more consistent.

And how is the behaviour of image('/images/default.png') explained? It generates:
<img src="localhost:8446/koobfaceDSL'/image/default.png'"> (note the quotes inside the other quotes)

Submitted by Niels Egberts on 6 April 2011 at 12:06

On 6 April 2011 at 13:12 Danny Groenewegen commented:

Indeed, the image template should use double quotes, here is an improved implementation that you can include in your application:

define img(s:String){
  <img src=s all attributes/>
}

It looks like the single quotes are allowed in the syntax, but the compiler assumes double quotes. This needs to be fixed (disallow single quotes).

Log in to post comments