Skip to content

Commit

Permalink
Remove deprecated plugins option
Browse files Browse the repository at this point in the history
This removes the already deprecated option `plugins`.
It’s renamed to `remarkPlugins`.
  • Loading branch information
wooorm committed Jan 17, 2022
1 parent bfa57ec commit cd845c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions lib/react-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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={}]
Expand Down Expand Up @@ -42,6 +41,7 @@ const changelog =

/** @type {Record<string, Deprecation>} */
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'},
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cd845c9

Please sign in to comment.