outline / rich-markdown-editor

The open source React and Prosemirror based markdown editor that powers Outline. Want to try it out? Create an account:
https://www.getoutline.com
BSD 3-Clause "New" or "Revised" License
2.87k stars 592 forks source link

Disabling link extension causes crash #477

Closed Benjamsk closed 3 years ago

Benjamsk commented 3 years ago

To Reproduce Setting disableExtensions={["link"]} causes a crash

Expected behavior First of all - I really enjoy ability to disable menu items. Setting "link" in the disabledExtentions-array cases an error though, and I am not sure what to do about it. Expected behaviour is that the ability to insert a link is removed from the menus.

Version 11.11.1

My Code

import Editor from "rich-markdown-editor";

export const MarkdownEditor = () => 
<Editor
  defaultValue="Hello world!"
  disableExtensions={["link"]}
/>

Console Uncaught TypeError: Cannot read property 'isInSet' of undefined at isMarkActive.ts:6 at SelectionToolbar.render (SelectionToolbar.tsx:139) at finishClassComponent (react-dom.development.js:17485) at updateClassComponent (react-dom.development.js:17435) at beginWork (react-dom.development.js:19073) at HTMLUnknownElement.callCallback (react-dom.development.js:3945) at Object.invokeGuardedCallbackDev (react-dom.development.js:3994) at invokeGuardedCallback (react-dom.development.js:4056) at beginWork$1 (react-dom.development.js:23964) at performUnitOfWork (react-dom.development.js:22776) at workLoopSync (react-dom.development.js:22707) at renderRootSync (react-dom.development.js:22670) at performSyncWorkOnRoot (react-dom.development.js:22293) at react-dom.development.js:11327 at unstable_runWithPriority (scheduler.development.js:468) at runWithPriority$1 (react-dom.development.js:11276) at flushSyncCallbackQueueImpl (react-dom.development.js:11322) at flushSyncCallbackQueue (react-dom.development.js:11309) at scheduleUpdateOnFiber (react-dom.development.js:21893) at Object.enqueueForceUpdate (react-dom.development.js:12504) at RichMarkdownEditor.push../node_modules/react/cjs/react.development.js.Component.forceUpdate (react.development.js:384) at EditorView.dispatchTransaction (index.tsx:517) at EditorView.dispatch (index.js:374) at Prism.ts:136