You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Dan Ziemba (JIRA)" <ji...@apache.org> on 2019/04/12 21:07:00 UTC

[jira] [Created] (GROOVY-9080) MarkupTemplateEngine uses invalid XML entity for escaping double quotes

Dan Ziemba created GROOVY-9080:
----------------------------------

             Summary: MarkupTemplateEngine uses invalid XML entity for escaping double quotes
                 Key: GROOVY-9080
                 URL: https://issues.apache.org/jira/browse/GROOVY-9080
             Project: Groovy
          Issue Type: Bug
          Components: Templating
    Affects Versions: 2.5.6, 3.0.0-alpha-4
            Reporter: Dan Ziemba


When MarkupTemplateEngine is used with 'useDoubleQuotes' config enabled, incorrect output is produced. 

Given this example code:
{code:java}
import groovy.text.markup.*

def out = new MarkupTemplateEngine(new TemplateConfiguration(useDoubleQuotes: true))
        .createTemplate('''tag(attr: 'contains " quote')''')
        .make()
println out
{code}
Result is:

{{<tag attr="contains &quote; quote"/>}}

But expected result is:

{{<tag attr="contains &quot; quote"/>}}

The wrong XML entity is used - &quote is not valid. 



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