Commit f92b3f57660cc2ff80723482e890f562d73c4424

Erin Wild 2017-10-15T13:19:02

Python: Add highlighting to functions with space between name and parentheses

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/components/prism-python.js b/components/prism-python.js
index cc6bc82..3159a31 100644
--- a/components/prism-python.js
+++ b/components/prism-python.js
@@ -12,7 +12,7 @@ Prism.languages.python= {
 		greedy: true
 	},
 	'function' : {
-		pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
+		pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\s*\()/g,
 		lookbehind: true
 	},
 	'class-name': {