Skip to content

Instantly share code, notes, and snippets.

@kswedberg
Created May 14, 2009 21:19
Show Gist options
  • Save kswedberg/111933 to your computer and use it in GitHub Desktop.
Save kswedberg/111933 to your computer and use it in GitHub Desktop.
{ name = 'source.js.jquery.embedded.html';
begin = '(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)';
end = '(?<=</(script|SCRIPT))(>)(?:\s*\n)?';
beginCaptures = {
1 = { name = 'punctuation.definition.tag.html'; };
2 = { name = 'entity.name.tag.script.html'; };
};
endCaptures = { 2 = { name = 'punctuation.definition.tag.html'; }; };
patterns = (
{ include = '#tag-stuff'; },
{ begin = '(?<!</(?:script|SCRIPT))(>)';
end = '(</)((?i:script))';
captures = {
1 = { name = 'punctuation.definition.tag.html'; };
2 = { name = 'entity.name.tag.script.html'; };
};
patterns = (
{ name = 'comment.line.double-slash.js';
match = '(//).*?((?=</script)|$\n?)';
captures = { 1 = { name = 'punctuation.definition.comment.js'; }; };
},
{ name = 'comment.block.js';
begin = '/\*';
end = '\*/|(?=</script)';
captures = { 0 = { name = 'punctuation.definition.comment.js'; }; };
},
{ include = '#php'; },
{ include = 'source.js'; },
);
},
);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment