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

MarkupBuilder indentation fails when combining yield statements and empty tags

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.6
    • Fix Version/s: 1.5.7, 1.6-beta-2
    • Component/s: groovy-jdk
    • Labels:
      None
    • Environment:
      Windows Vista x64

      Description

      MarkupBuilder seems to become confused if yield / yieldUnescaped calls and empty element are mixed within a single tag. All lines from that tag up to the end are 1 step less idented than they should be.
      Example Groovlet:

      def html = new groovy.xml.MarkupBuilder()
      html.html {
      	head {
      		title ("test")
      	}
      	body {
      		p {
      			yield "Some Text"
      			br()
      			yield "Another Text"
      		}
      	}
      }
      

      The output. You can see that there should be more whitespace before </p> and </body>.

      <html>
        <head>
          <title>test</title>
        </head>
        <body>
          <p>Some Text<br />Another Text
        </p>
      </body>
      </html>
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              illuvatar S. Ecret
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: