diff --git a/src/language/html.js b/src/language/html.js index 8aba431c..e3600408 100644 --- a/src/language/html.js +++ b/src/language/html.js @@ -7,11 +7,13 @@ Rainbow.extend('html', [ { name: 'source.php.embedded', matches: { + 1: 'variable.language.php-tag', 2: { language: 'php' - } + }, + 3: 'variable.language.php-tag' }, - pattern: /<\?=?(?!xml)(php)?([\s\S]*?)(\?>)/gm + pattern: /(<\?php|<\?=?(?!xml))([\s\S]*?)(\?>)/gm }, { name: 'source.css.embedded', diff --git a/test/language/html-test.js b/test/language/html-test.js index 692af34f..748108bc 100644 --- a/test/language/html-test.js +++ b/test/language/html-test.js @@ -58,9 +58,9 @@ describe(language, () => { `, `<ul class="articles"> - - <li></li> - + + <li></li> + </ul>` ); @@ -73,9 +73,9 @@ describe(language, () => {
<?= $user->getBio() ?>
<? endforeach ?>`, - ` - <p></p> - ` + ` + <p></p> + ` ); run(