Commit 2dc55342bea21f6e0bb7479c0061665ed4696289

Miles Johnson 2013-07-02T18:36:53

Use global match for hook

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/components/prism-php.js b/components/prism-php.js
index 2d6dd30..5a85250 100644
--- a/components/prism-php.js
+++ b/components/prism-php.js
@@ -78,13 +78,13 @@ if (Prism.languages.markup) {
 	// Wrap tokens in classes that are missing them
 	Prism.hooks.add('wrap', function(env) {
 		if (env.language === 'php' && env.type === 'markup') {
-			env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/, "<span class=\"token php\">$1</span>");
+			env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, "<span class=\"token php\">$1</span>");
 		}
 	});
 
 	// Add the rules before all others
 	Prism.languages.insertBefore('php', 'comment', {
 		'markup': Prism.languages.markup.tag,
-		'php': /\{\{\{PHP[0-9]+\}\}\}/
+		'php': /\{\{\{PHP[0-9]+\}\}\}/g
 	});
 }
\ No newline at end of file