Grails
  1. Grails
  2. GRAILS-7741

HTML context influences brackets and braces check which leads to GSP compilation errors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-M1
    • Component/s: View technologies
    • Labels:
    • Environment:
      Windows XP

      Description

      The following fragment produces exception even though it is a perfectly valid code:

      {{
      {<% if(something) { %> $

      {message}

      (

      {[<% }

      %>)
      }}

        Issue Links

          Activity

          Hide
          Matthias Hryniszak added a comment -

          In HTML there can be any number of different brackets, parenthesis and curly brackets and they need not be treated as errors even when they are not matched with a proper closing counterpart. The example above shows all the typical brackets (excluding angle bracket which is part of the HTML syntax) and it should work just fine and in fact it does in Grails 1.3.7.

          Show
          Matthias Hryniszak added a comment - In HTML there can be any number of different brackets, parenthesis and curly brackets and they need not be treated as errors even when they are not matched with a proper closing counterpart. The example above shows all the typical brackets (excluding angle bracket which is part of the HTML syntax) and it should work just fine and in fact it does in Grails 1.3.7.
          Hide
          Matthias Hryniszak added a comment -

          The problem is with GroovyPageScanner class as far as I can tell which does not make a distinction between Groovy context and HTML context.

          Show
          Matthias Hryniszak added a comment - The problem is with GroovyPageScanner class as far as I can tell which does not make a distinction between Groovy context and HTML context.
          Hide
          Matthias Hryniszak added a comment -

          This issue is related to another one I reported on GitHub (https://github.com/grails/grails-core/issues/78) but the fix I provided there does not fix the whole problem.

          Show
          Matthias Hryniszak added a comment - This issue is related to another one I reported on GitHub ( https://github.com/grails/grails-core/issues/78 ) but the fix I provided there does not fix the whole problem.
          Hide
          Matthias Hryniszak added a comment -
          Show
          Matthias Hryniszak added a comment - Here are a couple of test case that show the problem: https://github.com/padcom/grails-core/commit/8ff76970225a08b54ddd9d0caa1994f19e7d5336

            People

            • Assignee:
              Jeff Scott Brown
              Reporter:
              Matthias Hryniszak
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development