diff options
Diffstat (limited to 'app/assets/javascripts/behaviors/markdown/schema.js')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/schema.js | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/schema.js b/app/assets/javascripts/behaviors/markdown/schema.js index 8bea24584cc..1b0f46ff4cb 100644 --- a/app/assets/javascripts/behaviors/markdown/schema.js +++ b/app/assets/javascripts/behaviors/markdown/schema.js @@ -1,24 +1,20 @@ import { Schema } from 'prosemirror-model'; import editorExtensions from './editor_extensions'; -const nodes = editorExtensions - .filter((extension) => extension.type === 'node') - .reduce( - (ns, { name, schema }) => ({ - ...ns, - [name]: schema, - }), - {}, - ); +const nodes = editorExtensions.nodes.reduce( + (ns, { name, schema }) => ({ + ...ns, + [name]: schema, + }), + {}, +); -const marks = editorExtensions - .filter((extension) => extension.type === 'mark') - .reduce( - (ms, { name, schema }) => ({ - ...ms, - [name]: schema, - }), - {}, - ); +const marks = editorExtensions.marks.reduce( + (ms, { name, schema }) => ({ + ...ms, + [name]: schema, + }), + {}, +); export default new Schema({ nodes, marks }); |