aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextSchema.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-08-25 22:55:51 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-08-25 22:55:51 -0400
commit939074601016a674d6a01922bab1383684fce63f (patch)
tree070f4a9852eee3dd691d3c68ebbee6d47099ee0f /src/client/util/RichTextSchema.tsx
parent3531339719a70f73b3cc2312aeeafdc64c8574c4 (diff)
added sub-bullet types to prosemirror
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r--src/client/util/RichTextSchema.tsx45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx
index 9fdda4845..a8ce4731c 100644
--- a/src/client/util/RichTextSchema.tsx
+++ b/src/client/util/RichTextSchema.tsx
@@ -173,7 +173,46 @@ export const nodes: { [index: string]: NodeSpec } = {
ordered_list: {
...orderedList,
content: 'list_item+',
- group: 'block'
+ group: 'block',
+ attrs: {
+ bulletStyle: { default: "decimal" },
+ },
+ toDOM(node: Node<any>) {
+ return ['ol', { style: `list-style: ${node.attrs.bulletStyle}` }, 0]
+ }
+ },
+ alphabet_list: {
+ ...orderedList,
+ content: 'list_item+',
+ group: 'block',
+ attrs: {
+ bulletStyle: { default: "lower-alpha" },
+ },
+ toDOM(node: Node<any>) {
+ return ['ol', { style: `list-style: ${node.attrs.bulletStyle}` }, 0]
+ }
+ },
+ cap_alphabet_list: {
+ ...orderedList,
+ content: 'list_item+',
+ group: 'block',
+ attrs: {
+ bulletStyle: { default: "upper-alpha" },
+ },
+ toDOM(node: Node<any>) {
+ return ['ol', { style: `list-style: ${node.attrs.bulletStyle}` }, 0]
+ }
+ },
+ roman_list: {
+ ...orderedList,
+ content: 'list_item+',
+ group: 'block',
+ attrs: {
+ bulletStyle: { default: "lower-roman" },
+ },
+ toDOM(node: Node<any>) {
+ return ['ol', { style: `list-style: ${node.attrs.bulletStyle}` }, 0]
+ }
},
//this doesn't currently work for some reason
bullet_list: {
@@ -181,7 +220,9 @@ export const nodes: { [index: string]: NodeSpec } = {
content: 'list_item+',
group: 'block',
// parseDOM: [{ tag: "ul" }, { style: 'list-style-type=disc' }],
- // toDOM() { return ulDOM }
+ // toDOM() { return ['ol', {
+ // style: 'list-type: hebrew'
+ // }] }
},
//bullet_list: {