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

Remove deprecated markdownItPlugins plugin interface #286

Merged
merged 3 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
- Upgrade to PostCSS 8 ([#260](https://github.com/marp-team/marpit/issues/260), [#284](https://github.com/marp-team/marpit/pull/284))
- Upgrade Node and dependent packages to the latest version ([#285](https://github.com/marp-team/marpit/pull/285))

### Removed

- Remove deprecated `markdownItPlugins`, the getter of plugin interface for markdown-it ([#286](https://github.com/marp-team/marpit/pull/286))

## v1.6.4 - 2021-02-06

### Fixed
Expand Down
3 changes: 0 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ declare namespace Marpit {
}
readonly options: Options

/** @deprecated A plugin interface for markdown-it is deprecated and will remove in future version. Instead, wrap markdown-it instance when creating Marpit by `new Marpit({ markdown: markdownItInstance })`. */
readonly markdownItPlugins: (md: any) => void

protected lastComments: RenderResult['comments'] | undefined
protected lastGlobalDirectives: { [directive: string]: any } | undefined
protected lastSlideTokens: any[] | undefined
Expand Down
18 changes: 0 additions & 18 deletions src/marpit.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,6 @@ class Marpit {
}
}

/**
* The plugin interface of markdown-it for current Marpit instance.
*
* This is useful to integrate Marpit with the other markdown-it based parser.
*
* @deprecated A plugin interface for markdown-it is deprecated and will
* remove in future version. Instead, wrap markdown-it instance when
* creating Marpit by `new Marpit({ markdown: markdownItInstance })`.
* @type {Function}
* @readonly
*/
get markdownItPlugins() {
console.warn(
'Deprecation warning: A plugin interface for markdown-it provided by `markdownItPlugins` is deprecated and will remove in next major version. Instead, wrap markdown-it instance when creating Marpit by `new Marpit({ markdown: markdownItInstance })`.'
)
return this.applyMarkdownItPlugins.bind(this)
}

/** @private */
applyMarkdownItPlugins(md) {
this.markdown = md
Expand Down
14 changes: 0 additions & 14 deletions test/marpit.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,6 @@ describe('Marpit', () => {
})
})

describe('[DEPRECATED] get #markdownItPlugins', () => {
it('provides markdown-it plugins with its compatible interface', () => {
const marpit = new Marpit()
marpit.themeSet.add('/* @theme foobar */')

const md = new MarkdownIt().use(marpit.markdownItPlugins)
expect(marpit.markdown).toBe(md)
expect(md.marpit).toBe(marpit)

md.render('<!-- theme: foobar -->')
expect(marpit.lastGlobalDirectives.theme).toBe('foobar')
})
})

describe('#render', () => {
it('returns the object contains html, css, and comments', () => {
const markdown = '# Hello'
Expand Down