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
I was really confused by this and left me wondering whether the extension types had something in common (they don't). Then I realized TokenizerAndRendererExtensions are actually extensions options for MarkedExtensions.
Describe the solution you'd like
So I think something it would be better if the MarkedExtensions were renamed to MarkedPlugins or the option property extensions is renamed to tokenizerAndRendererExtensions. I mean, I don't really have a preference for a solution, but at least maybe prefix the word "extensions" in the doc with the type, so it is very clear which type of extention it is about. For example the docs have 2 sections "Known extensions" vs "Custom Extensions", but both talk about different types of extensions.
Context
I maintain @metalsmith/markdown which relies on marked and I'm working on upgrading to the latest version.
In that context I need to remap a single options object and pass some of them to marked. That means I need 2 config keys (eg 'markedExtensions', and 'tokenizerAndRendererExtensions') in an object to .use the plugins from a dictionary
The text was updated successfully, but these errors were encountered:
Is this still a valid issue? Personally I'd be leaning towards updating the documentation but keeping the code as is. I agree that it's a little confusing having the different types of extensions labeled as "extensions", but I feel like it's in the weeds enough to where as long as it's clear in the documentation than it would be ok.
What pain point are you perceiving?.
There are 2 types of extensions with marked:
There are 3 (and more) signatures:
new Marked(extension, extension, extension)
marked.use(extension)
marked.use({ extensions: [TokenizerAndRendererExtensions] })
I was really confused by this and left me wondering whether the extension types had something in common (they don't). Then I realized
TokenizerAndRendererExtensions
are actually extensions options for MarkedExtensions.Describe the solution you'd like
So I think something it would be better if the MarkedExtensions were renamed to MarkedPlugins or the option property
extensions
is renamed totokenizerAndRendererExtensions
. I mean, I don't really have a preference for a solution, but at least maybe prefix the word "extensions" in the doc with the type, so it is very clear which type of extention it is about. For example the docs have 2 sections "Known extensions" vs "Custom Extensions", but both talk about different types of extensions.Context
I maintain @metalsmith/markdown which relies on marked and I'm working on upgrading to the latest version.
In that context I need to remap a single options object and pass some of them to marked. That means I need 2 config keys (eg 'markedExtensions', and 'tokenizerAndRendererExtensions') in an object to
.use
the plugins from a dictionaryThe text was updated successfully, but these errors were encountered: