Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HTML] Fix scopes of stray script and style tags #3032

Merged

Commits on Sep 9, 2021

  1. [HTML] Fix scopes of stray script and style tags

    This commit ...
    
    1. fixes scopes of stray script and style tags, which didn't match
       those from tag pairs.
    
    2. avoids multi-pushing into embedded script/style syntaxes to simplify
       the language a bit and improve parsing performance. Closing tags are
       consumed within `main` context now.
    
    3. removes pushing `text.html.embedded.html` onto stack.
    
       a) As `main` context is pushed, it is not required for highlighting.
       b) The only thing we loose is the mentioned scope, which seems to be
          of little value.
       c) It is required as change (2) would break boundaries of
          `text.html.embedded` otherwise.
       d) The less contexts HTML pushes onto stack the better it is for most
          possible flexibility with regards to inheritance or re-use in
          heavily context aware templating syntaxes such as JSP or PHP.
       e) It slightly improves parsing performance.
    
    4. New `script-tag` and `style-tag` contexts are introduced to form a
       kind of template which can be used by inheriting syntaxes for other
       custom tags.
    
    Notes: 
    
    1. `script-close-tag` still exists, so existing syntaxes shouldn't
        break by this change.
    
    2.  ASP syntax is adjusted to use the same strategy, but that's just
        to keep inline. It would have worked without that change, too.
    deathaxe committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    611165d View commit details
    Browse the repository at this point in the history