Skip to content

Commit

Permalink
fix: allow marked v15 (#626)
Browse files Browse the repository at this point in the history
* fix: allow marked v15

* update tests
  • Loading branch information
UziTech authored Nov 9, 2024
1 parent eeb9d48 commit 915fba6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 48 deletions.
69 changes: 27 additions & 42 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions spec/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe('marked-gfm-heading-id', () => {
# foo 1
# foo
# foo
`;
const markdownTwo = `
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('marked-gfm-heading-id', () => {
# foo 1
# foo
# foo
`;
const markdownTwo = `
Expand Down Expand Up @@ -238,7 +238,7 @@ describe('marked-gfm-heading-id', () => {
# foo 1
# foo
# foo
`;
const markdownTwo = `
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 915fba6

Please sign in to comment.