Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.0 final
-
Fix Version/s: None
-
Component/s: TagLib
-
Labels:None
Description
When using Groovy's MarkupBuilder in a TagLib to render an HTML image the wrong method (namely ApplicationTagLib.img()) is called:
def myTag = { attrs, body ->
new MarkupBuilder(out).div {
img(src: 'image.png', alt: 'Description')
}
}
A possible workaround is to call 'img' explicitly on 'delegate':
def myTag = { attrs, body ->
new MarkupBuilder(out).div {
delegate.img(src: 'image.png', alt: 'Description')
}
}
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
The workaround is the correct way to implement this, another alternative is to use g.img.
There is no way to fix this without the user applying some manual scoping, closing...