diff --git a/lib/index.cjs b/lib/index.cjs index e2d75d6..176ebc9 100644 --- a/lib/index.cjs +++ b/lib/index.cjs @@ -116,7 +116,7 @@ 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; diff --git a/lib/index.umd.js b/lib/index.umd.js index 6cb2b91..3006004 100644 --- a/lib/index.umd.js +++ b/lib/index.umd.js @@ -120,7 +120,7 @@ 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;