2019-03-02 22:35:43 +05:30
|
|
|
import { Schema } from 'prosemirror-model';
|
|
|
|
import editorExtensions from './editor_extensions';
|
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
const nodes = editorExtensions.nodes.reduce(
|
|
|
|
(ns, { name, schema }) => ({
|
|
|
|
...ns,
|
|
|
|
[name]: schema,
|
|
|
|
}),
|
|
|
|
{},
|
|
|
|
);
|
2019-03-02 22:35:43 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
const marks = editorExtensions.marks.reduce(
|
|
|
|
(ms, { name, schema }) => ({
|
|
|
|
...ms,
|
|
|
|
[name]: schema,
|
|
|
|
}),
|
|
|
|
{},
|
|
|
|
);
|
2019-03-02 22:35:43 +05:30
|
|
|
|
|
|
|
export default new Schema({ nodes, marks });
|