valeriangalliat / markdown-it-anchor

A markdown-it plugin that adds an `id` attribute to headings and optionally permalinks.
The Unlicense
291 stars 72 forks source link

permalinkAttrs is not working #65

Closed nil closed 4 years ago

nil commented 4 years ago

I'm tring to add custom attribute to the anchor link but it is not working. This is the code I'm using:

import markdownIt from 'markdown-it';
import markdownItAnchor from 'markdown-it-anchor';

const md = new markdownIt().use(markdownItAnchor, {
  permalinkAttrs: () => ({ "aria-hidden":  false })
});

I've cloned this repository and when I run the tests with yarn test it returns an error.

valeriangalliat commented 4 years ago

Looks like running npm run build fixed the tests, I've published 5.2.7 with the new build! Lmk if that fixes your issue

Crazy how I didn't know myself that this project had a build system :joy:

nil commented 4 years ago

Yes, it is fixed 💯