public
Last active

TextMate javascript syntax highlighting for content_for :inline_js

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// To edit:
// Bundles -> Bundle Editor -> Edit Languages
// Open Ruby on Rails
// Edit HTML (Rails)
// add to the patterns
 
{
name = 'inline_js.rails.embedded.html';
begin = '<%\s+(content_for)\s+(:inline_js)\s+(do)\s+-?%>';
end = '<%\s+(end)\s+-?%>';
beginCaptures = {
1 = { name = 'support.function.viewhelpers.rails'; };
2 = { name = 'constant.other.symbol.double-quoted.ruby'; };
3 = { name = 'keyword.control.def.ruby'; };
};
endCaptures = { 1 = { name = 'keyword.control.def.ruby'; }; }; // make it blue
patterns = (
{ include = 'source.js'; }
);
}

Need to figure out how to not have a hack for the beginCaptures... But this works for now.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.