forked from sublimehq/Packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HTML] Fix scopes of stray script and style tags (sublimehq#3032)
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.
- Loading branch information
Showing
3 changed files
with
71 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters