diff options
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r-- | src/client/util/RichTextSchema.tsx | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx index f128162c2..6e3d9ab77 100644 --- a/src/client/util/RichTextSchema.tsx +++ b/src/client/util/RichTextSchema.tsx @@ -178,6 +178,14 @@ export const nodes: { [index: string]: NodeSpec } = { bulletStyle: { default: "decimal" }, }, toDOM(node: Node<any>) { + let first = node.firstChild; + while (first) { + if (first.marks.find((m) => m.type === schema.marks.mbulletType)) { + let x = first.marks.find((m) => m.type === schema.marks.mbulletType); + return ['ol', { style: `list-style: ${(x as any).attrs.bulletType}` }, 0] + } + first = first.firstChild; + } return ['ol', { style: `list-style: ${node.attrs.bulletStyle}` }, 0] } }, @@ -319,13 +327,15 @@ export const marks: { [index: string]: MarkSpec } = { toDOM: () => ['sup'] }, - malphabet_list: { - }, - mcap_alphabet_list: { - }, - mroman_list: { - }, - mo_list: { + mbulletType: { + attrs: { + bulletType: { default: "decimal" } + }, + toDOM(node: any) { + return ['span', { + style: `background: ${node.attrs.bulletType == "decimal" ? "yellow" : node.attrs.bulletType === "upper-alpha" ? "blue" : "green"}` + }]; + } }, highlight: { |