From cd845c9f38e0280b67fa33cc8e1fcf9d2cd0cc72 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 17 Jan 2022 19:13:34 +0100 Subject: [PATCH] Remove deprecated `plugins` option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the already deprecated option `plugins`. It’s renamed to `remarkPlugins`. --- changelog.md | 7 +++++++ lib/react-markdown.js | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 06335805..e4ab4b1d 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,13 @@ All notable changes will be documented in this file. +## 8.0.0 - 2022-01-17 + +### Change `plugins` to `remarkPlugins` + +This removes the already deprecated option `plugins`. +It’s renamed to `remarkPlugins`. + ## 7.0.1 - 2021-08-26 * [`ec387c2`](https://github.com/remarkjs/react-markdown/commit/ec387c2) diff --git a/lib/react-markdown.js b/lib/react-markdown.js index 58ef8169..6dbb085c 100644 --- a/lib/react-markdown.js +++ b/lib/react-markdown.js @@ -10,7 +10,6 @@ * @property {string} children * * @typedef PluginOptions - * @property {PluggableList} [plugins=[]] **deprecated**: use `remarkPlugins` instead * @property {PluggableList} [remarkPlugins=[]] * @property {PluggableList} [rehypePlugins=[]] * @property {import('remark-rehype').Options} [remarkRehypeOptions={}] @@ -42,6 +41,7 @@ const changelog = /** @type {Record} */ const deprecated = { + plugins: {to: 'plugins', id: 'change-plugins-to-remarkplugins'}, renderers: {to: 'components', id: 'change-renderers-to-components'}, astPlugins: {id: 'remove-buggy-html-in-markdown-parser'}, allowDangerousHtml: {id: 'remove-buggy-html-in-markdown-parser'}, @@ -86,8 +86,7 @@ export function ReactMarkdown(options) { const processor = unified() .use(remarkParse) - // TODO: deprecate `plugins` in v8.0.0. - .use(options.remarkPlugins || options.plugins || []) + .use(options.remarkPlugins || []) .use(remarkRehype, { ...options.remarkRehypeOptions, allowDangerousHtml: true