Commit 0c8c17891a6a6755a83b39a634d31560a7253690

Miles Johnson 2013-07-02T18:18:07

Quick fixes Removed PHP from examples

diff --git a/components/prism-clike.js b/components/prism-clike.js
index 449a787..bbbb1a2 100644
--- a/components/prism-clike.js
+++ b/components/prism-clike.js
@@ -20,7 +20,7 @@ Prism.languages.clike = {
 		}
 	},
 	'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
-	'operator': /[-+]{1,2}|!|=?&lt;|=?<|=?&gt;|=?>|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,
+	'operator': /[-+]{1,2}|!|&lt;=?|=?&gt;|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,
 	'ignore': /&(lt|gt|amp);/gi,
 	'punctuation': /[{}[\];(),.:]/g
 };
\ No newline at end of file
diff --git a/components/prism-clike.min.js b/components/prism-clike.min.js
index 9c17ab1..bfc016d 100644
--- a/components/prism-clike.min.js
+++ b/components/prism-clike.min.js
@@ -1 +1 @@
-Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:class|interface|extends|implements|trait|instanceof|new)\s+)[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g, operator:/[-+]{1,2}|!|=?&lt;|=?<|=?&gt;|=?>|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};
\ No newline at end of file
+Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:class|interface|extends|implements|trait|instanceof|new)\s+)[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g, operator:/[-+]{1,2}|!|&lt;=?|=?&gt;|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};
\ No newline at end of file
diff --git a/components/prism-php.js b/components/prism-php.js
index b476a71..2d6dd30 100644
--- a/components/prism-php.js
+++ b/components/prism-php.js
@@ -19,7 +19,7 @@ Prism.languages.php = Prism.languages.extend('clike', {
 Prism.languages.insertBefore('php', 'keyword', {
 	'deliminator': /(\?>|\?&gt;|&lt;\?php|<\?php|&lt;\?|<\?)/ig,
 	'this': /\$this/g,
-	'global': /\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/g,
+	//'global': /\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/g,
 	'variable': /(\$\w+)\b/ig,
 	'scope': {
 		pattern: /\b[\w\\]+::/g,
diff --git a/components/prism-php.min.js b/components/prism-php.min.js
index 62bfb06..1921612 100644
--- a/components/prism-php.min.js
+++ b/components/prism-php.min.js
@@ -1 +1 @@
-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|extends|private|protected|parent|static|throw|null|echo|print|trait|namespace|use|final|yield|goto)\b/ig,constant:/\b[A-Z0-9_]{2,}\b/g}); Prism.languages.insertBefore("php","keyword",{deliminator:/(\?>|\?&gt;|&lt;\?php|<\?php|&lt;\?|<\?)/ig,"this":/\$this/g,global:/\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/g,variable:/(\$\w+)\b/ig,scope:{pattern:/\b[\w\\]+::/g,inside:{keyword:/(static|self|parent)/,punctuation:/(::|\\)/}},"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/g,lookbehind:!0,inside:{punctuation:/\\/}}}); Prism.languages.insertBefore("php","operator",{property:{pattern:/(-&gt;)[\w]+/g,lookbehind:!0}}); Prism.languages.markup&&(Prism.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.code=a.code.replace(/(?:&lt;\?php|&lt;\?|<\?php|<\?)[\w\W]*?(?:\?&gt;|\?>)/ig,function(b){a.tokenStack.push(b);return"{{{PHP"+a.tokenStack.length+"}}}"}))}),Prism.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b=0,c;c=a.tokenStack[b];b++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(b+1)+"}}}",Prism.highlight(c,a.grammar,"php"));a.element.innerHTML=a.highlightedCode}}), Prism.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/,'<span class="token php">$1</span>'))}),Prism.languages.insertBefore("php","comment",{markup:Prism.languages.markup.tag,php:/\{\{\{PHP[0-9]+\}\}\}/}));
\ No newline at end of file
+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|extends|private|protected|parent|static|throw|null|echo|print|trait|namespace|use|final|yield|goto)\b/ig,constant:/\b[A-Z0-9_]{2,}\b/g}); Prism.languages.insertBefore("php","keyword",{deliminator:/(\?>|\?&gt;|&lt;\?php|<\?php|&lt;\?|<\?)/ig,"this":/\$this/g,variable:/(\$\w+)\b/ig,scope:{pattern:/\b[\w\\]+::/g,inside:{keyword:/(static|self|parent)/,punctuation:/(::|\\)/}},"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/g,lookbehind:!0,inside:{punctuation:/\\/}}});Prism.languages.insertBefore("php","operator",{property:{pattern:/(-&gt;)[\w]+/g,lookbehind:!0}}); Prism.languages.markup&&(Prism.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.code=a.code.replace(/(?:&lt;\?php|&lt;\?|<\?php|<\?)[\w\W]*?(?:\?&gt;|\?>)/ig,function(b){a.tokenStack.push(b);return"{{{PHP"+a.tokenStack.length+"}}}"}))}),Prism.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b=0,c;c=a.tokenStack[b];b++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(b+1)+"}}}",Prism.highlight(c,a.grammar,"php"));a.element.innerHTML=a.highlightedCode}}), Prism.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/,'<span class="token php">$1</span>'))}),Prism.languages.insertBefore("php","comment",{markup:Prism.languages.markup.tag,php:/\{\{\{PHP[0-9]+\}\}\}/}));
\ No newline at end of file
diff --git a/examples.html b/examples.html
index 5a44ff9..db40836 100644
--- a/examples.html
+++ b/examples.html
@@ -309,66 +309,6 @@ public class PrismJS {
 	<p>As you can notice String keyword is not highlighted because it's not a Java language keyword (cf. <a href="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html">Java Language Keywords</a>). The main reason is that String is not a primitive type such as <em>int</em> but a class type like <em>Integer</em>.</p>
 </section>
 
-<section class="language-php">
-	<h1>PHP</h1>
-
-	<pre><code>namespace Prism;
-
-use Some\Child\Class;
-
-class Prism extends AbstractClass implements Interface_Class {
-	const CONSTANT = 12345;
-	public $foo = true;
-	public static $bar = array('foo' =&gt; 'bar');
-
-	final public __construct(array $arg1, $arg2 = false) {
-		$this->foo = $arg2;
-		$this->bar = new Child\Class();
-
-		$int = 123456;
-		$string = 'Prism.js is the best!';
-		$bool = true;
-		$array = array('foo');
-		$shortArray = ['bar'];
-		$null = null;
-		$closure = function($var) use ($int) {
-			return $int * 2;
-		};
-	}
-
-	public function under_score() {
-		self::doSomething();
-		static::_other_method();
-	}
-
-	public function doSomething() {
-		$var = Static\Class::methodCall();
-
-		for ($i = 0; $i &lt;= 10; $i++) {
-			$var = str_replace($i, rand(), $var);
-		}
-
-		return $var;
-	}
-}</code></pre>
-
-	<h2>HTML then PHP</h2>
-	<pre><code>&lt;a href="&lt;?php echo $url; ?&gt;"&gt;Link&lt;/a&gt;</code></pre>
-
-	<h2>PHP then HTML (with short tags)</h2>
-	<pre><code>&lt;? if ($var) { ?&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;? } ?&gt;</code></pre>
-
-	<h2>PHP &amp; HTML</h2>
-	<pre><code>&lt;?php foreach (fetchData() as $key =&gt; $value) { ?>
-	&lt;li&gt;
-		&lt;? if ($value) { ?&gt;
-			&lt;span class="class-name"&gt;&lt;?php echo $value; ?&gt;&lt;/span&gt;
-		&lt;? } ?&gt;
-	&lt;/li&gt;
-&lt;?php } ?&gt;</code></pre>
-
-</section>
-
 <section class="language-coffeescript">
 	<h1>Coffeescript</h1>