You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be helpful to be able to pass the slugger instance in as configuration.
Problem
In the context of a page with multiple chunks of markdown, it's possible for the same slug to be generated more than once on the same page.
Expected behavior
If I anticipate that I'd like to be able to pass in an instance that the plugin would use to generate slugs rather than minting its own one. That way I can be in charge of resetting it when I decide it's necessary, and I can use the same slugger for multiple markdown renderings.
Alternatives
I suppose I could set a different clobberPrefix for each markdown field, but I'd rather not.
The text was updated successfully, but these errors were encountered:
Setting prefixes for different sections is a pretty smart idea imo.
This is a tiny plugin: 21 sloc. The complexity for users to maintain their own slug instances, and to code needed to supporting that here, maybe it’s just better to create your own version?
I agree in principle but I don't like the idea for my particular use case. The markdown in my case isn't from untrusted users, it's from a CMS, and it's a page-builder sort of thing. I want the slugs for headings to be as clean as possible, and I don't even know the section names ahead of time.
Good point about the small size of the plugin. Very reasonable idea to make my own.
Subject of the feature
It'd be helpful to be able to pass the slugger instance in as configuration.
Problem
In the context of a page with multiple chunks of markdown, it's possible for the same slug to be generated more than once on the same page.
Expected behavior
If I anticipate that I'd like to be able to pass in an instance that the plugin would use to generate slugs rather than minting its own one. That way I can be in charge of resetting it when I decide it's necessary, and I can use the same slugger for multiple markdown renderings.
Alternatives
I suppose I could set a different clobberPrefix for each markdown field, but I'd rather not.
The text was updated successfully, but these errors were encountered: