debian-mirror-gitlab/app/assets/javascripts/behaviors/markdown/schema.js
2022-05-07 20:08:51 +05:30

20 lines
388 B
JavaScript

import { Schema } from 'prosemirror-model';
import editorExtensions from './editor_extensions';
const nodes = editorExtensions.nodes.reduce(
(ns, { name, schema }) => ({
...ns,
[name]: schema,
}),
{},
);
const marks = editorExtensions.marks.reduce(
(ms, { name, schema }) => ({
...ms,
[name]: schema,
}),
{},
);
export default new Schema({ nodes, marks });