The open source React and Prosemirror based markdown editor that powers Outline. Want to try it out? Create an account:
Extension
class is now exportedonKeyDown
handler no longer marked as requiredreadOnly
modev10.0.0
is a complete rewrite of the editor. It is incompatible with v9.0.0
and moves from using Slate to Prosemirror as the framework. Some reasoning behind this change is available in the the issue, but notably the release includes fixes for more than 20 issues, an order of magnitude increase in rendering performance, and support for soft keyboards (non-latin/mobile character input).
The output of the editor is slightly different than before. Empty paragraphs are now encoded with a backslash and checklists require a leading "-" character. Loading a document created in v9 in v10 will not render 1-1 without first migrating the data. You can do so with the following code:
import MarkdownSerializer from "slate-md-serializer";
const serializer = new MarkdownSerializer();
const nodes = serializer.deserialize(v9text);
const v10text = serializer.serialize(nodes, { version: 2 });
It is highly recommended you backup the original data.
toc
prop was removed. You can utilize the new getHeadings()
method to build your own table of contents that matches the style of the host app, if required.getLinkComponent
prop was removed. It was replaced with a new structure for defining embeds.plugins
prop was removed. It's no longer possible to use Slate plugins, this was replaced with the extensions
prop where Prosemirror plugins can be used to extend the editor instead.hiddenToolbarButtons
prop was removed, there is no replacement.serializer
prop was removed, there is no replacement.theme
prop keys changed to support new design.space
character to activatevalue
prop. https://github.com/outline/rich-markdown-editor/issues/120
onShowToast
callback now includes an id
as the second parameter that can be used to identify the message and provide your own text copy.renderNode
prop was removed, instead create a standard Slate plugin that exposes a renderNode method. (#62)jpeg
added to acceptable mimetypes (#66)0.44.9
renderPlaceholder
was removed, it's now recommend to create a placeholder plugin and pass it to the plugins
prop.This breaking change alters the return value of onChange
to be a method, see details here: https://github.com/outline/rich-markdown-editor/pull/30
The load order of Slate plugins was also reversed to prefer the host apps.
This breaking change refactors the theme file to allow for easier theming based on semantics rather than colors. Also included is a default dark theme that can be enabled with the dark
boolean prop.
If you are not passing your own theme to the editor then you should be able to upgrade this major bump without issue.