Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #71 from rwstauner/perl-empty-q-ops

Allow perl quote-like operators to be empty
  • Loading branch information...
commit 985329b83daa5e0ad7f50b14a972177acabf0510 2 parents 19626a0 + 0e99c88
@alexgorbatchev authored
Showing with 6 additions and 5 deletions.
  1. +5 −5 scripts/shBrushPerl.js
  2. +1 −0  tests/brushes/perl.html
View
10 scripts/shBrushPerl.js
@@ -48,11 +48,11 @@
{ regex: /-?\w+(?=\s*=(>|>))/g, css: 'string' }, // fat comma
// is this too much?
- { regex: /\bq[qwxr]?\([\s\S]+?\)/g, css: 'string' }, // quote-like operators ()
- { regex: /\bq[qwxr]?\{[\s\S]+?\}/g, css: 'string' }, // quote-like operators {}
- { regex: /\bq[qwxr]?\[[\s\S]+?\]/g, css: 'string' }, // quote-like operators []
- { regex: /\bq[qwxr]?(<|&lt;)[\s\S]+?(>|&gt;)/g, css: 'string' }, // quote-like operators <>
- { regex: /\bq[qwxr]?([^\w({<[])[\s\S]+?\1/g, css: 'string' }, // quote-like operators non-paired
+ { regex: /\bq[qwxr]?\([\s\S]*?\)/g, css: 'string' }, // quote-like operators ()
+ { regex: /\bq[qwxr]?\{[\s\S]*?\}/g, css: 'string' }, // quote-like operators {}
+ { regex: /\bq[qwxr]?\[[\s\S]*?\]/g, css: 'string' }, // quote-like operators []
+ { regex: /\bq[qwxr]?(<|&lt;)[\s\S]*?(>|&gt;)/g, css: 'string' }, // quote-like operators <>
+ { regex: /\bq[qwxr]?([^\w({<[])[\s\S]*?\1/g, css: 'string' }, // quote-like operators non-paired
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
View
1  tests/brushes/perl.html
@@ -27,6 +27,7 @@
sub something (;$) { Print @_ } # upper-case P
*Other::Package::foo = sub { q!bad! };
+my $str = do { my $empty = q{}; $empty .= q'_'; };
print <<HERE;
doc;
Please sign in to comment.
Something went wrong with that request. Please try again.