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

MarkupTemplateEngine uses invalid XML entity for escaping double quotes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha-4, 2.5.6
    • Fix Version/s: 3.0.0-beta-1, 2.5.7
    • Component/s: Templating
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: