diff --git a/markdown-it-attrs.browser.js b/markdown-it-attrs.browser.js index 0f485eb..e96c6aa 100644 --- a/markdown-it-attrs.browser.js +++ b/markdown-it-attrs.browser.js @@ -267,7 +267,11 @@ module.exports = [{ var attrToken = tokens[i].children[j - 1]; var attrs = utils.getAttrs(token.content, 0); utils.addAttrs(attrs, attrToken); - token.content = token.content.slice(endChar + 1); + if (token.content.length === endChar + 1) { + tokens[i].children.splice(j, 1); + } else { + token.content = token.content.slice(endChar + 1); + } } }, { /** diff --git a/package-lock.json b/package-lock.json index 83adfb8..b384bf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "markdown-it-attrs", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ab94200..22c8afb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-it-attrs", - "version": "1.1.0", + "version": "1.1.1", "description": "Add classes, identifiers and attributes to your markdown with {} curly brackets, similar to pandoc's header attributes", "main": "index.js", "license": "MIT",