From 0cd968f45d8f507108478d993b1a28f6eab335f7 Mon Sep 17 00:00:00 2001 From: Arve Seljebu Date: Mon, 23 Dec 2024 15:47:59 +0100 Subject: [PATCH] 4.3.1 --- markdown-it-attrs.browser.js | 14 ++++++++++---- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/markdown-it-attrs.browser.js b/markdown-it-attrs.browser.js index 5115ad3..01df3c6 100644 --- a/markdown-it-attrs.browser.js +++ b/markdown-it-attrs.browser.js @@ -86,10 +86,16 @@ module.exports = function attributes(md, options_) { return res.match; }); if (match) { - pattern.transform(tokens, i, j); - if (pattern.name === 'inline attributes' || pattern.name === 'inline nesting 0') { - // retry, may be several inline attributes - _p--; + try { + pattern.transform(tokens, i, j); + if (pattern.name === 'inline attributes' || pattern.name === 'inline nesting 0') { + // retry, may be several inline attributes + _p--; + } + } catch (error) { + // eslint-disable-next-line no-console + console.error("markdown-it-attrs: Error in pattern '".concat(pattern.name, "': ").concat(error.message)); + console.error(error.stack); } } p = _p; diff --git a/package-lock.json b/package-lock.json index 6a348a1..d52ef7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "markdown-it-attrs", - "version": "4.3.0", + "version": "4.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "markdown-it-attrs", - "version": "4.3.0", + "version": "4.3.1", "license": "MIT", "devDependencies": { "@babel/core": "^7.20.5", diff --git a/package.json b/package.json index d706d64..d8f0dfa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-it-attrs", - "version": "4.3.0", + "version": "4.3.1", "description": "Add classes, identifiers and attributes to your markdown with {} curly brackets, similar to pandoc's header attributes", "main": "index.js", "license": "MIT",