-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose the markdown parser #482
Comments
Hey, I'm new to saber but I'd like to contribute if possible. As I understand it implementing this feature would mean taking some of the functionality from the markdown transformer and making it available on the saber instance so that plugins are able to make use of it? |
@brattonross yes, like the saber/packages/saber/lib/index.js Line 23 in e87d81f
|
So currently the function signature that I have for render looks like this: render(markdownCode, {
defaultPlugins = true,
plugins = [],
options = {},
env = {}
} = {}) {
// ...
} I'm assuming here that the second argument is optional, and that by default the default plugins should be used. I then merge the options which are passed in with the existing options: const chain = new ConfigChain()
chain.options.merge(
Object.assign(
{
html: true,
linkify: true,
highlight: markdown.highlighter
},
markdown.options,
options
)
) I have a couple of questions about the plugins; firstly, should the call to the if (defaultPlugins) {
// Load built-in plugins
chain.loadPlugins(builtInPlugins, configDir)
this.api.hooks.chainMarkdown.call(chain)
// Load plugins from config file
if (markdown.plugins) {
chain.loadPlugins(markdown.plugins, configDir)
}
}
// We could move the hook call here?
// Load user-defined plugins
chain.loadPlugins(plugins, ) Secondly, as you can see above I haven't passed a second argument to |
Feature request
What problem does this feature solve?
Allow plugins to use this API to turn Markdown into HTML.
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: