Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@leongaban
Created March 29, 2015 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leongaban/cbf0be3de060db1be1d5 to your computer and use it in GitHub Desktop.
Save leongaban/cbf0be3de060db1be1d5 to your computer and use it in GitHub Desktop.
Fixing auto comments in HTML files in Sublime Text 2 & 3
http://wesbos.com/fix-sublime-text-toggle-comment/
The underlying problem is inside the HTML syntax file and it is actually an easy fix.
We need to edit the HTML.tmLanguage file that is located in preferences → browse packages → HTML.
Open it up and look for a line that looks like the following. It should be around line 286.
<string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)</string>
Replace it with this:
<string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)(?!.*&lt;/script&gt;)</string>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment