Commit 4166b2fdd2b701b67b7cad78eb1de9b7a1e52555

Golmote 2014-12-22T21:27:03

Add support for single quoted multi-line strings in Python

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 4ba15fa..34d44c6 100644
--- a/components/prism-python.js
+++ b/components/prism-python.js
@@ -3,7 +3,7 @@ Prism.languages.python= {
 		pattern: /(^|[^\\])#.*?(\r?\n|$)/g,
 		lookbehind: true
 	},
-	'string': /"""[\s\S]+?"""|("|')(\\?.)*?\1/g,
+	'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/g,
 	'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/g,
 	'boolean' : /\b(True|False)\b/g,
 	'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/g,