Skip to content

Commit

Permalink
Fixed adding duplicating modifier; added check for text node (0.1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdee committed Oct 4, 2015
1 parent f67a458 commit dad005e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ module.exports = function (config) {
if ('mod' in attributes) {
classSet.mods = attributes.mod;
delete node.attrs.mod;
} else {
classSet.mods = '';
}

classes = _createClassList(classSet);
Expand Down Expand Up @@ -97,8 +99,8 @@ module.exports = function (config) {

if (node.content && Array.isArray(node.content)) {
node.content.forEach(function (children) {
if (children.attrs.elem) {
elem = _assignClassList('elem', block, children.attrs, children);
if (children.tag && children.attrs.elem) {
elem = _assignClassList('elem', block, children.attrs, children);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "posthtml-bem",
"version": "0.1.0",
"version": "0.1.1",
"description": "PostHTML-plugin for creating BEM-named class structure",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit dad005e

Please sign in to comment.