Merge pull request #245 from themightychris/patch-1 support for PHP's #-style comments
diff --git a/components/prism-php.js b/components/prism-php.js
index 9d20b4f..9599f69 100644
--- a/components/prism-php.js
+++ b/components/prism-php.js
@@ -13,7 +13,11 @@
Prism.languages.php = Prism.languages.extend('clike', {
'keyword': /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/ig,
- 'constant': /\b[A-Z0-9_]{2,}\b/g
+ 'constant': /\b[A-Z0-9_]{2,}\b/g,
+ 'comment': {
+ pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/|#).*?(\r?\n|$))/g,
+ lookbehind: true
+ },
});
Prism.languages.insertBefore('php', 'keyword', {