aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/util/RichTextSchema.tsx9
-rw-r--r--src/client/views/nodes/FormattedTextBox.scss13
2 files changed, 19 insertions, 3 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];
}
},
};
diff --git a/src/client/views/nodes/FormattedTextBox.scss b/src/client/views/nodes/FormattedTextBox.scss
index 1b537cc52..1e429e4be 100644
--- a/src/client/views/nodes/FormattedTextBox.scss
+++ b/src/client/views/nodes/FormattedTextBox.scss
@@ -65,4 +65,15 @@
.em {
font-style: italic;
-} \ No newline at end of file
+}
+
+
+ol { counter-reset: deci 0;}
+.decimal-ol {counter-reset: deci 0;}
+.upper-alpha-ol {counter-reset: ualph; }
+.lower-roman-ol {counter-reset: lroman; }
+.lower-alpha-ol {counter-reset: lalpha; }
+.decimal:before { content: counter(deci) " "; counter-increment: deci }
+.upper-alpha:before { content: counter(deci) "." counter(ualph, upper-alpha) " "; counter-increment: ualph }
+.lower-roman:before { content: counter(deci) "." counter(ualph, upper-alpha) "." counter(lroman, lower-roman) " "; counter-increment: lroman }
+.lower-alpha:before { content: counter(deci) "." counter(ualph, upper-alpha) "." counter(lroman, lower-roman) "." counter(lalpha, lower-alpha)" "; counter-increment: lalpha }