Skip to content
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

Enhance plugin system to control Marpit features #127

Merged
merged 7 commits into from
Jan 30, 2019
Merged

Enhance plugin system to control Marpit features #127

merged 7 commits into from
Jan 30, 2019

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jan 30, 2019

We enhanced markdown-it plugin system to be able to toggle Marpit features by the plugin. markdown-it's StateCore has marpit(), and you can turn off Marpit core rules by calling marpit(false) before normalize rule.

marpit.use(md => md.core.ruler.before('normalize', 'disable', state => state.marpit(false)))

Motivation

Marpit has an interface of markdown-it plugin and can extend a plain markdown-it by marpit.markdownItPlugins. We are planning to create Marp VSCode plugin by making use of this ability. (yhatt/marp#118)

Currently, Marpit cannot disable by injected markdown-it instance. But this implementation would get a skill to control Marpit features.

@yhatt yhatt mentioned this pull request Jan 30, 2019
@yhatt yhatt merged commit dda4636 into master Jan 30, 2019
@yhatt yhatt deleted the marpit-env branch January 30, 2019 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant