From 3898d21cc93e5a30345cce51c7361a725740ece9 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Fri, 15 Nov 2019 11:49:32 +0200 Subject: [PATCH] add block quote schema --- editors/editoria/src/Editoria.js | 1 - wax-prosemirror-core/src/Wax.js | 9 ++++----- wax-prosemirror-schema/src/EditoriaSchema.js | 12 +++++++++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/editors/editoria/src/Editoria.js b/editors/editoria/src/Editoria.js index c3a2218c6..c7877c017 100644 --- a/editors/editoria/src/Editoria.js +++ b/editors/editoria/src/Editoria.js @@ -12,7 +12,6 @@ import text from "./text"; const options = { schema, plugins, - keys, rules }; diff --git a/wax-prosemirror-core/src/Wax.js b/wax-prosemirror-core/src/Wax.js index 4d0c0c142..46650eb9a 100644 --- a/wax-prosemirror-core/src/Wax.js +++ b/wax-prosemirror-core/src/Wax.js @@ -43,10 +43,9 @@ class Wax extends Component { const { schema, plugins, keys, rules } = options; const WaxOnchange = onChange ? onChange : value => true; - const WaxKeys = - options && options.keys - ? options.keys - : new CreateShortCuts({ schema: schema, shortCuts: {} }); + const WaxShortCuts = keys + ? keys + : new CreateShortCuts({ schema: schema, shortCuts: {} }); const WaxRules = new CreateRules({ schema: schema, rules: rules }); @@ -54,7 +53,7 @@ class Wax extends Component { const finalPlugins = defaultPlugins.concat([ placeholder({ content: this.props.placeholder }), - WaxKeys, + WaxShortCuts, WaxRules ]); if (plugins) finalPlugins.push(...plugins); diff --git a/wax-prosemirror-schema/src/EditoriaSchema.js b/wax-prosemirror-schema/src/EditoriaSchema.js index 52ee19cff..caec4d856 100644 --- a/wax-prosemirror-schema/src/EditoriaSchema.js +++ b/wax-prosemirror-schema/src/EditoriaSchema.js @@ -1,6 +1,7 @@ // Npdes const pDOM = ["p", 0], - brDOM = ["br"]; + brDOM = ["br"], + blockquoteDOM = ["blockquote", 0]; //Marks const emDOM = ["em", 0], @@ -477,6 +478,15 @@ const EditoriaSchema = { return ["li", attrs, 0]; }, defining: true + }, + blockquote: { + content: "block+", + group: "block", + defining: true, + parseDOM: [{ tag: "blockquote" }], + toDOM() { + return blockquoteDOM; + } } }, marks: { -- GitLab