Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9080

MarkupTemplateEngine uses invalid XML entity for escaping double quotes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-4, 2.5.6
    • 3.0.0-beta-1, 2.5.7
    • Templating
    • None

    Description

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

      Given this example code:

      import groovy.text.markup.*
      
      def out = new MarkupTemplateEngine(new TemplateConfiguration(useDoubleQuotes: true))
              .createTemplate('''tag(attr: 'contains " quote')''')
              .make()
      println out
      

      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. 

      Attachments

        Activity

          People

            paulk Paul King
            zman0900 Dan Ziemba
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: