groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8844) MarkupTemplateEngine does not render main tag
Date Mon, 15 Oct 2018 12:23:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16650134#comment-16650134
] 

Paul King commented on GROOVY-8844:
-----------------------------------

Looks like an unintended side-effect for the fix for GROOVY-8764 that we mustn't have had
test coverage for. :(
 Temp workaround if it's possible for you is to use {{this.main}} instead of {{main}}.

> MarkupTemplateEngine does not render main tag
> ---------------------------------------------
>
>                 Key: GROOVY-8844
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8844
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.3
>         Environment: groovy -version
> Groovy Version: 2.5.3 JVM: 11 Vendor: Oracle Corporation OS: Linux
> java -version
> openjdk version "11" 2018-09-25
> OpenJDK Runtime Environment 18.9 (build 11+28)
> OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
>            Reporter: Frank Becker
>            Priority: Major
>         Attachments: MarkupTemplateBroken.groovy, exception.txt
>
>
> Since 2.5.3 the MarkupTemplateEngine does not render <main> tags anymore.
> Executing the following script throws an Exception. See exception.txt.
> {code}
> import groovy.text.markup.TemplateConfiguration
> import groovy.text.markup.MarkupTemplateEngine
> def config = new TemplateConfiguration()
> MarkupTemplateEngine engine = new MarkupTemplateEngine(config)
> def template = engine.createTemplate '''
>   html {
>     head {
>       title('a title')
>     }
>     body {
>       main {
>         p('inside main of body')
>       }
>     }
>   }
> '''
> StringWriter rendered = new StringWriter()
> template.make().writeTo(rendered)
> assert rendered.toString() == "<html><head><title>a title</title></head><body><main><p>inside
main of body</p></main></body></html>"
> {code}
> It's the same for jdk 8. With 2.5.2 the script executes successful.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message