Update prosemirror

This commit is contained in:
Mathias Biilmann Christensen
2016-12-27 23:13:31 -08:00
parent 6af6cceb2a
commit 06218e55eb
3 changed files with 147 additions and 140 deletions

View File

@ -88,7 +88,7 @@ function createSerializer(schema, plugins) {
plugins.forEach((plugin) => {
serializer.nodes[`plugin_${ plugin.get('id') }`] = (state, node) => {
const toBlock = plugin.get('toBlock');
state.write(toBlock.call(plugin, node.attrs));
state.write(toBlock.call(plugin, node.attrs) + '\n\n');
};
});
return serializer;
@ -210,7 +210,7 @@ export default class Editor extends Component {
handleBlock = (plugin, data) => {
const { schema } = this.state;
const nodeType = schema.nodes[`plugin_${ plugin.get('id') }`];
this.view.props.onAction(this.view.state.tr.replaceSelection(nodeType.create(data.toJS())).action());
this.view.props.onAction(this.view.state.tr.replaceSelectionWith(nodeType.create(data.toJS())).action());
};
handleToggle = () => {