diff --git a/build/engines.js b/build/engines.js index 59ab8f6..b08a052 100644 --- a/build/engines.js +++ b/build/engines.js @@ -31,10 +31,11 @@ const markdownEngines = { }, }) .use(mAnchor, { - permalink: mAnchor.permalink.ariaHidden({ + permalink: mAnchor.permalink.linkInsideHeader({ class: 'header-link', symbol: '', - renderHref: slugify, + renderHref: (input) => '#' + slugify(decodeURIComponent(input)), + ariaHidden: true, }), }) .use(require('./lib/markdown-raw-html'), { debug: false }), diff --git a/build/lib/slugify.js b/build/lib/slugify.js index c25be74..0f6ca72 100644 --- a/build/lib/slugify.js +++ b/build/lib/slugify.js @@ -1,5 +1,6 @@ const slugs = require('slugify'); module.exports = exports = function slugify (s) { - return slugs(s, { remove: /[*+~.,()'"!?:@/\\]/g }).toLowerCase(); + const result = slugs(s, { remove: /[*+~.,()'"!?:@/\\]/g }).toLowerCase(); + return result; };