Socket
Socket
Sign inDemoInstall

react-markdown

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-markdown - npm Package Versions

23
10

9.0.1

Diff

wooorm
published 9.0.0 •

Changelog

Source

9.0.0 - 2023-09-27

Add urlTransform

The transformImageUri and transformLinkUri were removed. Having two functions is a bit much, particularly because there are more URLs you might want to change (or which might be unsafe so we make them safe). And their name and APIs were a bit weird. You can use the new urlTransform prop instead to change all your URLs.

Remove linkTarget

The linkTarget option was removed; you should likely not set targets. If you want to, use rehype-external-links.

Remove includeElementIndex

The includeElementIndex option was removed, so index is never passed to components. Write a plugin to pass index:

<details> <summary>Show example of plugin</summary>
import {visit} from 'unist-util-visit'

function rehypePluginAddingIndex() {
  /**
   * @param {import('hast').Root} tree
   * @returns {undefined}
   */
  return function (tree) {
    visit(tree, function (node, index) {
      if (node.type === 'element' && typeof index === 'number') {
        node.properties.index = index
      }
    })
  }
}
</details>

Remove rawSourcePos

The rawSourcePos option was removed, so sourcePos is never passed to components. All components are passed node, so you can get node.position from them.

Remove sourcePos

The sourcePos option was removed, so data-sourcepos is never passed to elements. Write a plugin to pass index:

<details> <summary>Show example of plugin</summary>
import {stringifyPosition} from 'unist-util-stringify-position'
import {visit} from 'unist-util-visit'

function rehypePluginAddingIndex() {
  /**
   * @param {import('hast').Root} tree
   * @returns {undefined}
   */
  return function (tree) {
    visit(tree, function (node) {
      if (node.type === 'element') {
        node.properties.dataSourcepos = stringifyPosition(node.position)
      }
    })
  }
}
</details>

Remove extra props passed to certain components

When overwriting components, these props are no longer passed:

  • inline on code — create a plugin or use pre for the block
  • level on h1, h2, h3, h4, h5, h6 — check node.tagName instead
  • checked on li — check task-list-item class or check props.children
  • index on li — create a plugin
  • ordered on li — create a plugin or check the parent
  • depth on ol, ul — create a plugin
  • ordered on ol, ul — check node.tagName instead
  • isHeader on td, th — check node.tagName instead
  • isHeader on tr — create a plugin or check children
wooorm
published 8.0.7 •

Changelog

Source

8.0.7 - 2023-04-12

Full Changelog: https://github.com/remarkjs/react-markdown/compare/8.0.6...8.0.7

wooorm
published 8.0.6 •

Changelog

Source

8.0.6 - 2023-03-20

wooorm
published 8.0.5 •

Changelog

Source

8.0.5 - 2023-01-17

wooorm
published 8.0.4 •

Changelog

Source

8.0.4 - 2022-12-01

wooorm
published 8.0.3 •

Changelog

Source

8.0.3 - 2022-04-20

wooorm
published 8.0.2 •

Changelog

Source

8.0.2 - 2022-03-31

wooorm
published 8.0.1 •

Changelog

Source

8.0.1 - 2022-03-14

wooorm
published 8.0.0 •

Changelog

Source

8.0.0 - 2022-01-17

<a name="change-plugins-to-remarkplugins"></a>

  • cd845c9 Remove deprecated plugins option
    (migrate by renaming it to remarkPlugins)
  • 36e4916 Update remark-rehype, add support for passing it options
    by @peolic in #669
    (migrate by removing remark-footnotes and updating remark-gfm if you were using them, otherwise you shouldn’t notice this)
23
10
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