Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arve0 committed Sep 15, 2017
1 parent 0a2e781 commit d4e5261
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions markdown-it-attrs.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,16 @@ exports.getAttrs = function (str, start, end) {
continue;
}

// {.class}
if (char_ === classChar && key === '') {
key = 'class';
parsingKey = false;
continue;
// {.class} {..css-module}
if (char_ === classChar) {
if (key === '') {
key = 'class';
parsingKey = false;
continue;
} else if (key === 'class') {
key = 'css-module';
continue;
}
}

// {#id}
Expand Down Expand Up @@ -590,6 +595,8 @@ exports.addAttrs = function (attrs, token) {
var key = attrs[j][0];
if (key === 'class') {
token.attrJoin('class', attrs[j][1]);
} else if (key === 'css-module') {
token.attrJoin('css-module', attrs[j][1]);
} else {
token.attrPush(attrs[j]);
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "markdown-it-attrs",
"version": "1.1.1",
"version": "1.2.0",
"description": "Add classes, identifiers and attributes to your markdown with {} curly brackets, similar to pandoc's header attributes",
"main": "index.js",
"license": "MIT",
Expand Down

0 comments on commit d4e5261

Please sign in to comment.