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

Make permalink functions' opts arg optional #114

Closed mvargeson closed 2 years ago

mvargeson commented 2 years ago

The new safariReaderFix opt for headerLink and the opts arg itself for all permalink functions are required in the types. It does not look like that matches reality in the implementation as defaults are applied to these. This changes the types definition to mark all of these as optional.

If this does not appear to be the case, then the headerLink section of the README should be updated to remove the headerLink() example shown without an opts arg.

I'm not sure what appropriate contribution guidelines are or if there are specific tests to run so largely looking for feedback on if this is a reasonable change and if there are any quality checks I need to perform.

valeriangalliat commented 2 years ago

Thanks a lot @mvargeson, that's a great catch, I forgot the ? when I added the safariReaderFix option to the types earlier today.

It's also 100% correct that the opts argument is optional for permalink functions, thanks for updating the types to also reflect that :pray:

I released your fix as part of v8.6.2