diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-08-27 09:13:07 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-08-27 09:13:07 -0400 |
commit | 074961d68788d2d19b6bfbcc9b95712a7b3940eb (patch) | |
tree | 266bba03590b8518f23654b8a8af0365d30fc9e0 /src/client/util/RichTextSchema.tsx | |
parent | e13dc44532ea5f94bdc13a2103bc4a00438ee617 (diff) |
not quite working...
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r-- | src/client/util/RichTextSchema.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx index 255f4a60d..655edb68a 100644 --- a/src/client/util/RichTextSchema.tsx +++ b/src/client/util/RichTextSchema.tsx @@ -178,8 +178,10 @@ export const nodes: { [index: string]: NodeSpec } = { bulletStyle: { default: "decimal" }, }, toDOM(node: Node<any>) { + (node.content as any).content.map((x: any) => x.type.attrs.className = node.attrs.bulletStyle); let fsize = node.attrs.bulletStyle === "decimal" ? 24 : node.attrs.bulletStyle === "upper-alpha" ? 18 : node.attrs.bulletStyle === "lower-roman" ? 14 : 10; - return ['ol', { style: `list-style: ${node.attrs.bulletStyle}; font-size: ${fsize}` }, 0] + return ['ol', { class: `${node.attrs.bulletStyle}-ol`, style: `list-style: none; font-size: ${fsize}` }, 0] + //return ['ol', { class: `${node.attrs.bulletStyle}`, style: `list-style: ${node.attrs.bulletStyle}; font-size: ${fsize}` }, 0] } }, //this doesn't currently work for some reason @@ -202,6 +204,9 @@ export const nodes: { [index: string]: NodeSpec } = { //select: state => true, // }, list_item: { + attrs: { + className: { default: "" } + }, ...listItem, content: 'paragraph block*', toDOM(node: any) { @@ -213,7 +218,7 @@ export const nodes: { [index: string]: NodeSpec } = { } first = first.firstChild; } - return ["li", 0]; + return ["li", { class: node.type.attrs.className }, 0]; } }, }; |