1 import {Schema} from "prosemirror-model";
2 import {schema as basicSchema} from "prosemirror-schema-basic";
3 import {addListNodes} from "prosemirror-schema-list";
5 const baseNodes = addListNodes(basicSchema.spec.nodes, "paragraph block*", "block");
6 const baseMarks = basicSchema.spec.marks;
10 type: {default: 'info'},
16 {tag: 'p.callout.info', attrs: {type: 'info'}, priority: 75,},
17 {tag: 'p.callout.success', attrs: {type: 'success'}, priority: 75,},
18 {tag: 'p.callout.danger', attrs: {type: 'danger'}, priority: 75,},
19 {tag: 'p.callout.warning', attrs: {type: 'warning'}, priority: 75,},
20 {tag: 'p.callout', attrs: {type: 'info'}, priority: 75},
23 const type = node.attrs.type || 'info';
24 return ['p', {class: 'callout ' + type}, 0];
28 const markUnderline = {
29 parseDOM: [{tag: "u"}, {style: "text-decoration=underline"}],
31 return ["span", {style: "text-decoration: underline;"}, 0];
35 const customNodes = baseNodes.append({
39 const customMarks = baseMarks.append({
40 underline: markUnderline,
43 const schema = new Schema({
48 export default schema;