groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Ziemba (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-9080) MarkupTemplateEngine uses invalid XML entity for escaping double quotes
Date Fri, 12 Apr 2019 21:11:00 GMT

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

Dan Ziemba commented on GROOVY-9080:
------------------------------------

Looks like all that is needed is to fix the 'groovy.text.markup.BaseTemplate#escapeQuotes'
method.

> 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: 3.0.0-alpha-4, 2.5.6
>            Reporter: Dan Ziemba
>            Priority: Major
>
> 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)

Mime
View raw message