From c6593662097899a2d553571c75a78d82a3defa27 Mon Sep 17 00:00:00 2001 From: otegami Date: Tue, 8 Oct 2024 21:11:08 +0800 Subject: [PATCH] Remove a depreacated warning about markdown-it-anchor permalink option Issue A deprecated warning is raised because the currently specified option is outdated. ```console % npm run serve ... Warning: Using deprecated markdown-it-anchor permalink option, see https://github.com/valeriangalliat/markdown-it-anchor#permalinks ... ``` Solution Update the markdown-it-anchor permalink option to use the current configuration. ref: https://github.com/valeriangalliat/markdown-it-anchor#permalinks --- .eleventy.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index f69a01ba..f400a6e3 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -13,10 +13,11 @@ var md = require('markdown-it')({ module.exports = function(eleventyConfig) { md.use(markdownItAnchor, { // add anchors to headings level: '2', - permalink: 'true', - permalinkClass: 'anchor', - permalinkSymbol: '﹟', - permalinkBefore: 'true' + permalink: markdownItAnchor.permalink.ariaHidden({ + class: 'anchor', + symbol: '#', + placement: 'before' + }), }); md.use(markdownItToc, { // make a TOC with ${toc} level: '2',