diff --git a/markdown-it-attrs.browser.js b/markdown-it-attrs.browser.js index ef90393..acc681b 100644 --- a/markdown-it-attrs.browser.js +++ b/markdown-it-attrs.browser.js @@ -497,9 +497,11 @@ module.exports = function (options) { var content = token.content; var attrs = utils.getAttrs(content, content.lastIndexOf(options.leftDelimiter), options); var ii = i + 1; - while (tokens[ii + 1] && tokens[ii + 1].nesting === -1) { - ii++; - } + do { + if (tokens[ii] && tokens[ii].nesting === -1) { + break; + } + } while (ii++ < tokens.length); var openingToken = utils.getMatchingOpeningToken(tokens, ii); utils.addAttrs(attrs, openingToken); var trimmed = content.slice(0, content.lastIndexOf(options.leftDelimiter)); diff --git a/package-lock.json b/package-lock.json index 5fab0a8..94718fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "markdown-it-attrs", - "version": "4.1.6", + "version": "4.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "markdown-it-attrs", - "version": "4.1.6", + "version": "4.2.0", "license": "MIT", "devDependencies": { "@babel/core": "^7.20.5", diff --git a/package.json b/package.json index bdc7e4d..d108241 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-it-attrs", - "version": "4.1.6", + "version": "4.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",