Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix util.bemParseKey() to work with multicomponent tech extension

  • Loading branch information...
commit 0a32f7847edd48962af81d332c9bbab00558afae 1 parent 94a0933
@arikon arikon authored
Showing with 5 additions and 1 deletion.
  1. +1 −1  lib/util.js
  2. +4 −0 test/util.js
View
2  lib/util.js
@@ -637,7 +637,7 @@ exports.bemType = function(item) {
var bemItemRe = '([^_.]+)',
bemKeyRe = new RegExp('^(?:' + bemItemRe + ')?' +
'(?:__' + bemItemRe + ')?(?:_' + bemItemRe + '(?:_' + bemItemRe + ')?)?' +
- '(?:\.' + bemItemRe + ')?$');
+ '(?:\.([^_]+))?$');
/**
* Parse BEM-entity key into BEM-entity object.
View
4 test/util.js
@@ -148,6 +148,10 @@ describe('util', function() {
assert.deepEqual(U.bemParseKey('block.css'), { block: 'block', tech: 'css' });
});
+ it('block.decl.js', function() {
+ assert.deepEqual(U.bemParseKey('block.decl.js'), { block: 'block', tech: 'decl.js' });
+ });
+
it('block_mod.css', function() {
assert.deepEqual(U.bemParseKey('block_mod.css'), {
block: 'block',
Please sign in to comment.
Something went wrong with that request. Please try again.