Skip to content

Commit dd02755

Browse files
Fix PHP in HTML style tags
1 parent 31b011f commit dd02755

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

extensions/php/build/update-grammar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const updateGrammar = require('../../../build/npm/update-grammar');
88

99
function adaptInjectionScope(grammar) {
1010
// we're using the HTML grammar from https://github.com/textmate/html.tmbundle which has moved away from source.js.embedded.html
11+
// also we need to add source.css scope for PHP code in <style> tags, which are handled differently in atom
1112
const oldInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:((text.html.php meta.tag) - (meta.embedded.block.php | meta.embedded.line.php)), L:(source.js.embedded.html - (meta.embedded.block.php | meta.embedded.line.php))";
12-
const newInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:((text.html.php meta.tag) - (meta.embedded.block.php | meta.embedded.line.php)), L:(source.js - (meta.embedded.block.php | meta.embedded.line.php))";
13+
const newInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:((text.html.php meta.tag) - (meta.embedded.block.php | meta.embedded.line.php)), L:(source.js - (meta.embedded.block.php | meta.embedded.line.php)), L:(source.css - (meta.embedded.block.php | meta.embedded.line.php))";
1314

1415
const injections = grammar.injections;
1516
const injection = injections[oldInjectionKey];

0 commit comments

Comments
 (0)