Skip to content

Commit

Permalink
Remove a depreacated warning about markdown-it-anchor permalink option
Browse files Browse the repository at this point in the history
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
  • Loading branch information
otegami committed Oct 8, 2024
1 parent c0839a5 commit c659366
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit c659366

Please sign in to comment.