Add support for blockRenderMap
See original GitHub issueJust wanted to bring this up for discussion as I started working on new plugin. draft-js has recently added support for passing a custom Map
through a blockRenderMap
prop but its support in the plugin system is as-yet unresolved.
The main to think about here with regard to the plugin system is: how do you reconcile things if multiple plugins provide a blockRenderMap
?
For example, the plugin I’m working on at the moment overrides the entire block map to ensure that only one type of block is allowed. If the plugin editor merges blockRenderMap
s then that use case would fail. Could you provide a way for individual plugins to specify some sort of priority
and/or merge/replace
property?
Note that the draft-js-plugins-editor
currently supports a single blockRenderMap
being passed to it, in that it simply passes that onto the standard draft-js <Editor>
. Is that actually enough? In which case, good work team 😄
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
FWIW, I have a working prototype on my own editor with code like this:
In this implementation, the plugins can return either a Map() or a JS object.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.