groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Esteban GĂ­nez <>
Subject Bug in MarkupTemplateEngine?
Date Fri, 20 Nov 2015 04:47:08 GMT
Hey guys

I've been playing with the MarkupTemplateEngine these past few days, I
wanted to use it in lieu of gsp..(no offense to gsp's but the groovy
templates are way nicer).

As a first step I was able to hack a taglib that allows to 'embed' groovy
templates in your gsp
like so
..some gsp
h1('some h1 title) { a('some more text') }
....contnue gsp

While doing so I noticed that some interesting rendering...

import groovy.text.markup.MarkupTemplateEngine
def eng = new MarkupTemplateEngine()

def w = new StringWriter()
eng.createTemplate ('''
n1('text1'){ n2('text2') }
assert w.toString() == '<n1>text1<n2>text2</n2></n1>'

The above assertion evaluates to false, the string that gets generated is

Wondering if some has seen this in the past or is a known bug. I haven't
looked into the code yet but I'll do it a little later
Any input is appreciated
Thanks guys

View raw message