Merge pull request #261 from milesj/php-fixes Removed HTML entities
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/components/prism-php.js b/components/prism-php.js
index 9599f69..971af8d 100644
--- a/components/prism-php.js
+++ b/components/prism-php.js
@@ -4,7 +4,7 @@
*
* Supports the following:
* - Extends clike syntax
- * - Support for PHP 5.3 and 5.4 (namespaces, traits, etc)
+ * - Support for PHP 5.3+ (namespaces, traits, generators, etc)
* - Smarter constant and function matching
*
* Adds the following new token classes:
@@ -17,11 +17,11 @@ Prism.languages.php = Prism.languages.extend('clike', {
'comment': {
pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/|#).*?(\r?\n|$))/g,
lookbehind: true
- },
+ }
});
Prism.languages.insertBefore('php', 'keyword', {
- 'delimiter': /(\?>|<\?php|<\?)/ig,
+ 'delimiter': /(\?>|<\?php|<\?)/ig,
'variable': /(\$\w+)\b/ig,
'package': {
pattern: /(\\|namespace\s+|use\s+)[\w\\]+/g,
@@ -52,7 +52,7 @@ if (Prism.languages.markup) {
env.tokenStack = [];
- env.code = env.code.replace(/(?:<\?php|<\?|<\?php|<\?)[\w\W]*?(?:\?>|\?>)/ig, function(match) {
+ env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function(match) {
env.tokenStack.push(match);
return '{{{PHP' + env.tokenStack.length + '}}}';
@@ -82,7 +82,7 @@ if (Prism.languages.markup) {
// Add the rules before all others
Prism.languages.insertBefore('php', 'comment', {
'markup': {
- pattern: /(<|<)[^?]\/?(.*?)(>|>)/g,
+ pattern: /<[^?]\/?(.*?)>/g,
inside: Prism.languages.markup
},
'php': /\{\{\{PHP[0-9]+\}\}\}/g