aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextSchema.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-09-03 23:07:42 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-09-03 23:07:42 -0400
commit155cf5c5a1b45aafe7a5632f2ee6ecf957f04dde (patch)
tree1ddf0986b067944a1ab07925768722bafd746c28 /src/client/util/RichTextSchema.tsx
parent4921ef0121818381e4139137c0d204d41cb64a20 (diff)
fixes for bullets
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r--src/client/util/RichTextSchema.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx
index 25d972857..75e982872 100644
--- a/src/client/util/RichTextSchema.tsx
+++ b/src/client/util/RichTextSchema.tsx
@@ -203,7 +203,6 @@ export const nodes: { [index: string]: NodeSpec } = {
const decMap = bs ? "decimal" + bs : "";
const multiMap = bs === 1 ? "decimal1" : bs === 2 ? "upper-alpha" : bs === 3 ? "lower-roman" : bs === 4 ? "lower-alpha" : "";
let map = node.attrs.mapStyle === "decimal" ? decMap : multiMap;
- for (let i = 0; i < node.childCount; i++) node.child(i).attrs.className = map;
return ['ol', { class: `${map}-ol`, style: `list-style: none;` }, 0];
//return node.attrs.bulletStyle < 2 ? ['ol', { class: `${map}-ol`, style: `list-style: none;` }, 0] :
// ['ol', { class: `${node.attrs.bulletStyle}`, style: `list-style: ${node.attrs.bulletStyle}; font-size: 5px` }, "hello"];
@@ -216,7 +215,6 @@ export const nodes: { [index: string]: NodeSpec } = {
group: 'block',
// parseDOM: [{ tag: "ul" }, { style: 'list-style-type=disc' }],
toDOM(node: Node<any>) {
- for (let i = 0; i < node.childCount; i++) node.child(i).attrs.className = "";
return ['ul', 0];
}
},
@@ -231,12 +229,17 @@ export const nodes: { [index: string]: NodeSpec } = {
// },
list_item: {
attrs: {
- className: { default: "" }
+ bulletStyle: { default: 0 },
+ mapStyle: { default: "decimal" },
},
...listItem,
content: 'paragraph block*',
toDOM(node: any) {
- return ["li", { class: node.attrs.className }, 0];
+ const bs = node.attrs.bulletStyle;
+ const decMap = bs ? "decimal" + bs : "";
+ const multiMap = bs === 1 ? "decimal1" : bs === 2 ? "upper-alpha" : bs === 3 ? "lower-roman" : bs === 4 ? "lower-alpha" : "";
+ let map = node.attrs.mapStyle === "decimal" ? decMap : multiMap;
+ return ["li", { class: `${map}` }, 0];
}
},
};