react-markdown v5.0.0 Release Notes

Release Date: 2020-10-19 // over 3 years ago
  • ๐Ÿ’ฅ BREAKING

    Maintained by unified

    This project is now maintained by the unified collective, which also houses the underlying tools used in react-markdown: hundreds of projects for working with markdown and markup related things (including MDX). โšก๏ธ We have cleaned the project: updated dependencies, improved ๐Ÿ“„ docs/tests/coverage/types, cleaned the issue tracker, and fixed a couple of bugs, but otherwise much should be the same.

    โฌ†๏ธ Upgrade remark-parse

    โฌ†๏ธ The parser used in react-markdown has been upgraded to the latest version. It is now 100% CommonMark compliant: that means it works the same as in other places, such as Discourse, Reddit, Stack Overflow, and GitHub. Note that GitHub does extend CommonMark: to match how Markdown works on GitHub, ๐Ÿ”Œ use the remark-gfm plugin.

    ๐Ÿ†• New serializer property: node

    A new node prop is passed to all non-tag/non-fragment renderers. This contains the raw mdast AST node, which opens up a number of interesting possibilities. The breaking change is for renderers which blindly spread their props to an underlying component/tag. For instance:

    <ReactMarkdown renderers={{link: props => <a {...props} />}} โ€ฆ />
    

    Should now be written as:

    <ReactMarkdown renderers={{link: ({node, ...props}) => <a {...props} />}} โ€ฆ />
    

    List/list item tight property replaced by spread

    Previously, the tight property would hint as to whether or not list items should be wrapped in paragraphs. This logic has now been replaced by a new spread property, which behaves slightly differently. Read more.