Skip to content

Commit

Permalink
Add support for the <?= delimiter in PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitgeist87 committed May 8, 2017
1 parent 84107fa commit 3ce7488
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/prism-php.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Prism.languages.insertBefore('php', 'class-name', {

Prism.languages.insertBefore('php', 'keyword', {
'delimiter': {
pattern: /\?>|<\?(?:php)?/i,
pattern: /\?>|<\?(?:php|=)?/i,
alias: 'important'
},
'variable': /\$\w+\b/i,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-php.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions tests/languages/markup+php/php_in_markup_feature.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tests/languages/php/delimiter_feature.test
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<? ?>
<?php ?>
<?= ?>

----------------------------------------------------

[
["delimiter", "<?"],
["delimiter", "?>"],
["delimiter", "<?php"],
["delimiter", "?>"],
["delimiter", "<?="],
["delimiter", "?>"]
]

Expand Down

0 comments on commit 3ce7488

Please sign in to comment.