From 8cb7bd165dde1329f60c52e9ef393beb74bb809f Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Fri, 26 Mar 2021 00:36:36 +0900 Subject: [PATCH 1/2] Remove deprecated markdownItPlugins getter --- index.d.ts | 3 --- src/marpit.js | 18 ------------------ test/marpit.js | 14 -------------- 3 files changed, 35 deletions(-) diff --git a/index.d.ts b/index.d.ts index 5bdd70cf..a5b474ea 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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 diff --git a/src/marpit.js b/src/marpit.js index 5d718414..31276e2a 100644 --- a/src/marpit.js +++ b/src/marpit.js @@ -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 diff --git a/test/marpit.js b/test/marpit.js index 2f6cf2fe..475a5d3c 100644 --- a/test/marpit.js +++ b/test/marpit.js @@ -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('') - expect(marpit.lastGlobalDirectives.theme).toBe('foobar') - }) - }) - describe('#render', () => { it('returns the object contains html, css, and comments', () => { const markdown = '# Hello' From d73ea345daf037cfa64c771100ab0125d91bf43d Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Sat, 27 Mar 2021 02:43:50 +0900 Subject: [PATCH 2/2] [ci skip] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e6dca0f..85da123d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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