Merge pull request #978 from nfagerlund/june2016_puppet_regexes Puppet highlighter: Fix over-greedy regexp detection
diff --git a/components/prism-puppet.js b/components/prism-puppet.js
index 620a60b..7035ad6 100644
--- a/components/prism-puppet.js
+++ b/components/prism-puppet.js
@@ -41,7 +41,7 @@
},
'regex': {
// Must be prefixed with the keyword "node" or a non-word char
- pattern: /((?:\bnode\s+|[^\s\w\\]\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,
+ pattern: /((?:\bnode\s+|[~=\(\[\{,]\s*|[=+]>\s*|^\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,
lookbehind: true,
inside: {
// Extended regexes must have the x flag. They can contain single-line comments.