Skip to content

Commit

Permalink
Handle quotes inside curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
ccampbell committed Apr 4, 2015
1 parent c2f5b0a commit 34b9c62
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/language/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generic language patterns
*
* @author Craig Campbell
* @version 1.0.11
* @version 1.0.13
*/
Rainbow.extend([
{
Expand All @@ -25,7 +25,7 @@ Rainbow.extend([
}
}
},
'pattern': /(\(|\s|\[|\=|:|\+|\.)(('|")([^\\\1]|\\.)*?(\3))/gm
'pattern': /(\(|\s|\[|\=|:|\+|\.|\{)(('|")([^\\\1]|\\.)*?(\3))/gm
},
{
'name': 'comment',
Expand Down
12 changes: 12 additions & 0 deletions tests/language/test.javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,16 @@ describe(language, function() {
'<span class="storage">var</span> <span class="entity function">parseAndHighlight</span> <span class="keyword operator">=</span> <span class="keyword">function</span>() {};\n' +
'<span class="storage">var</span> <span class="entity function">parseAndHighlight2</span> <span class="keyword operator">=</span> <span class="keyword">function</span>() {};'
);

run(
language,

'quotes inside curly brackets',

'{\' \'}\n' +
'var str = \'something\';',

'{<span class="string">\' \'</span>}\n' +
'<span class="keyword">var</span> str <span class="keyword operator">=</span> <span class="string">\'something\'</span>;'
);
});
2 changes: 1 addition & 1 deletion util/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, js_path, closure_path, theme_path=None):
'coffeescript': '1.0',
'css': '1.0.9',
'd': '1.0',
'generic': '1.0.12',
'generic': '1.0.13',
'go': '1.0',
'haskell': '1.0.1',
'html': '1.0.9',
Expand Down

0 comments on commit 34b9c62

Please sign in to comment.