Skip to content

Commit

Permalink
Merge pull request #286 from marp-team/remove-deprecated-plugin-inter…
Browse files Browse the repository at this point in the history
…face

Remove deprecated `markdownItPlugins` plugin interface
  • Loading branch information
yhatt authored Mar 26, 2021
2 parents b65a0e0 + d73ea34 commit 815f4f3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
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

0 comments on commit 815f4f3

Please sign in to comment.