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
Export the extension as a custom Renderer class (or a function that returns an object with Renderer interface) so that it's compatible with Marked's extension system.
This way, we can override or adjust something when necessary in our apps, or experiment before including it here. This also makes some options like extensions unnecessary.
The text was updated successfully, but these errors were encountered:
We might want to rename extensions to something else, like blockExtensions – since they are really about extending the block syntax and we need to know the extension name (otherwise we will assume it is a language).
extensions shouldn't be necessary if we make it compatible. This extension shouldn't be handling them.
If I'm understanding how Marked's extension works correctly, users can either:
do marked.use(thisExtension, customExtension). customExtension provides new %foo, then fall backs to this extension for anything else.
create CustomRenderer that inherits from this extension's Renderer that handles anything new and fall backs to this extension.
If the extension needs something like afterRender. It can be exposed from the custom renderer that extends this one.
constrenderer=newCustomRenderer(options);// inherits from this extension'sconsthtml=marked(markdown,{ renderer });// After inserting to documentrenderer.afterRender();
Export the extension as a custom
Renderer
class (or a function that returns an object withRenderer
interface) so that it's compatible with Marked's extension system.Instead of
do
This way, we can override or adjust something when necessary in our apps, or experiment before including it here. This also makes some options like
extensions
unnecessary.The text was updated successfully, but these errors were encountered: