diff --git a/package-lock.json b/package-lock.json index a7a5f68..18749ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,13 +26,13 @@ "eslint": "^9.14.0", "globals": "^15.12.0", "jest-cli": "^29.7.0", - "marked": "^14.1.3", + "marked": "^15.0.0", "rollup": "^4.24.4", "semantic-release": "^24.2.0", "tsd": "^0.31.2" }, "peerDependencies": { - "marked": ">=13 <15" + "marked": ">=13 <16" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -2725,18 +2725,6 @@ } } }, - "node_modules/@rollup/plugin-node-resolve/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.24.4", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.4.tgz", @@ -7454,10 +7442,11 @@ } }, "node_modules/marked": { - "version": "14.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-14.1.3.tgz", - "integrity": "sha512-ZibJqTULGlt9g5k4VMARAktMAjXoVnnr+Y3aCqW1oDftcV4BA3UmrBifzXoZyenHRk75csiPu9iwsTj4VNBT0g==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.0.tgz", + "integrity": "sha512-0mouKmBROJv/WSHJBPZZyYofUgawMChnD5je/g+aOBXsHDjb/IsnTQj7mnhQZu+qPJmRQ0ecX3mLGEUm3BgwYA==", "dev": true, + "license": "MIT", "bin": { "marked": "bin/marked.js" }, @@ -7481,13 +7470,14 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -10520,10 +10510,11 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -14663,12 +14654,6 @@ "estree-walker": "^2.0.2", "picomatch": "^2.3.1" } - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true } } }, @@ -18045,9 +18030,9 @@ "dev": true }, "marked": { - "version": "14.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-14.1.3.tgz", - "integrity": "sha512-ZibJqTULGlt9g5k4VMARAktMAjXoVnnr+Y3aCqW1oDftcV4BA3UmrBifzXoZyenHRk75csiPu9iwsTj4VNBT0g==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.0.tgz", + "integrity": "sha512-0mouKmBROJv/WSHJBPZZyYofUgawMChnD5je/g+aOBXsHDjb/IsnTQj7mnhQZu+qPJmRQ0ecX3mLGEUm3BgwYA==", "dev": true }, "merge-stream": { @@ -18063,13 +18048,13 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" } }, "mime": { @@ -20129,9 +20114,9 @@ "dev": true }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "pify": { diff --git a/package.json b/package.json index 40d445d..354acdc 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ }, "homepage": "https://github.com/markedjs/marked-gfm-heading-id#readme", "peerDependencies": { - "marked": ">=13 <15" + "marked": ">=13 <16" }, "dependencies": { "github-slugger": "^2.0.0" @@ -59,7 +59,7 @@ "eslint": "^9.14.0", "globals": "^15.12.0", "jest-cli": "^29.7.0", - "marked": "^14.1.3", + "marked": "^15.0.0", "rollup": "^4.24.4", "semantic-release": "^24.2.0", "tsd": "^0.31.2" diff --git a/spec/index.test.js b/spec/index.test.js index e814736..e0c2815 100644 --- a/spec/index.test.js +++ b/spec/index.test.js @@ -176,7 +176,7 @@ describe('marked-gfm-heading-id', () => { # foo 1 # foo - + # foo `; const markdownTwo = ` @@ -207,7 +207,7 @@ describe('marked-gfm-heading-id', () => { # foo 1 # foo - + # foo `; const markdownTwo = ` @@ -238,7 +238,7 @@ describe('marked-gfm-heading-id', () => { # foo 1 # foo - + # foo `; const markdownTwo = ` diff --git a/src/index.js b/src/index.js index 28a45e7..bd48bfd 100644 --- a/src/index.js +++ b/src/index.js @@ -35,7 +35,7 @@ export function gfmHeadingId({ prefix = '', globalSlugs = false } = {}) { renderer: { heading({ tokens, depth }) { const text = this.parser.parseInline(tokens); - const raw = unescape(this.parser.parseInline(tokens, this.parser.textRenderer)) + const raw = unescape(text) .trim() .replace(/<[!\/a-z].*?>/gi, ''); const level = depth;