Thanks for the advice, Roy.
Looking at HTML.tmLanguage, there is explicit support for embedded code from other languages, like Python, PHP, etc. Near as I can tell, there’s no way for a separate file to augment highlighting rules for HTML files, akin to vim’s after/syntax/ tree.
I was able to make inline CoffeeScript work by hacking HTML.tmLanguage (quoted below because .diff, .patch, and .txt files are not allowed here). It’d be nice if this could be included ST2. (I’ll try to draw Jon’s attention to this via userecho.)
--- HTML.tmLanguage.orig 2012-10-01 19:35:56.655201040 -0400
+++ HTML.tmLanguage 2012-10-01 19:29:12.575221356 -0400
@@ -283,6 +283,68 @@
</dict>
<dict>
<key>begin</key>
+ <string>(?:^\s+)?(<)((?i:script))\b(?=^>]*type *=^>]*text/coffeescript)\b(?!^>]*/>)</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.tag.html</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.tag.script.html</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>(?<=</(script|SCRIPT))(>)(?:\s*\n)?</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.tag.html</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>source.coffee.embedded.html</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#tag-stuff</string>
+ </dict>
+ <dict>
+ <key>begin</key>
+ <string>(?<!</(?:script|SCRIPT))(>)</string>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.tag.html</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.tag.script.html</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>(</)((?i:script))</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>source.coffee</string>
+ </dict>
+ </array>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>begin</key>
<string>(?:^\s+)?(<)((?i:script))\b(?!^>]*/>)</string>
<key>beginCaptures</key>
<dict>