Skip to content

Commit ea10827

Browse files
authored
Merge pull request microsoft#80657 from KapitanOczywisty/patch-1
Fix PHP in HTML style tags
2 parents 9f2d08e + f57f8f7 commit ea10827

2 files changed

Lines changed: 3 additions & 2 deletions

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];

extensions/php/syntaxes/html.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
}
110110
]
111111
},
112-
"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))": {
112+
"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))": {
113113
"patterns": [
114114
{
115115
"include": "#php-tag"

0 commit comments

Comments
 (0)