Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-markdown

Package Overview
Dependencies
Maintainers
2
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-markdown - npm Package Compare versions

Comparing version 7.1.2 to 8.0.0

5

lib/react-markdown.d.ts

@@ -45,8 +45,5 @@ /**

export type PluginOptions = {
/**
* **deprecated**: use `remarkPlugins` instead
*/
plugins?: import('unified').PluggableList | undefined
remarkPlugins?: import('unified').PluggableList | undefined
rehypePlugins?: import('unified').PluggableList | undefined
remarkRehypeOptions?: import('mdast-util-to-hast/lib').Options | undefined
}

@@ -53,0 +50,0 @@ export type LayoutOptions = {

11

lib/react-markdown.js

@@ -13,5 +13,5 @@ /**

* @typedef PluginOptions
* @property {PluggableList} [plugins=[]] **deprecated**: use `remarkPlugins` instead
* @property {PluggableList} [remarkPlugins=[]]
* @property {PluggableList} [rehypePlugins=[]]
* @property {import('remark-rehype').Options} [remarkRehypeOptions={}]
*

@@ -45,2 +45,3 @@ * @typedef LayoutOptions

const deprecated = {
plugins: {to: 'plugins', id: 'change-plugins-to-remarkplugins'},
renderers: {to: 'components', id: 'change-renderers-to-components'},

@@ -90,5 +91,7 @@ astPlugins: {id: 'remove-buggy-html-in-markdown-parser'},

.use(remarkParse)
// TODO: deprecate `plugins` in v8.0.0.
.use(options.remarkPlugins || options.plugins || [])
.use(remarkRehype, {allowDangerousHtml: true})
.use(options.remarkPlugins || [])
.use(remarkRehype, {
...options.remarkRehypeOptions,
allowDangerousHtml: true
})
.use(options.rehypePlugins || [])

@@ -95,0 +98,0 @@ .use(rehypeFilter, options)

{
"name": "react-markdown",
"version": "7.1.2",
"version": "8.0.0",
"description": "React component to render markdown",

@@ -90,3 +90,3 @@ "license": "MIT",

"remark-parse": "^10.0.0",
"remark-rehype": "^9.0.0",
"remark-rehype": "^10.0.0",
"space-separated-tokens": "^2.0.0",

@@ -108,3 +108,3 @@ "style-to-object": "^0.3.0",

"esbuild": "^0.14.0",
"eslint-config-xo-react": "^0.25.0",
"eslint-config-xo-react": "^0.26.0",
"eslint-plugin-es": "^4.0.0",

@@ -111,0 +111,0 @@ "eslint-plugin-react": "^7.0.0",

@@ -178,2 +178,4 @@ <!--

list of [rehype plugins][rehype-plugins] to use
* `remarkRehypeOptions` (`Object?`, default: `undefined`)\
options to pass through to [`remark-rehype`][remark-rehype]
* `className` (`string?`)\

@@ -737,2 +739,4 @@ wrap the markdown in a `div` with this class name

[remark-rehype]: https://github.com/remarkjs/remark-rehype
[awesome-remark]: https://github.com/remarkjs/awesome-remark

@@ -739,0 +743,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc