aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextSchema.tsx
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-10-23 22:22:34 -0400
committerFawn <fangrui_tong@brown.edu>2019-10-23 22:22:34 -0400
commitbd817ac118c53845c882b89c4b8a110dc8fe10c2 (patch)
tree669b3aeb4daac0e7419473f17c9e1e010ad0f934 /src/client/util/RichTextSchema.tsx
parent43b09cb2aded66e67006d99e544d90637a62c048 (diff)
added dropdown to highlighter tool to choose colors
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r--src/client/util/RichTextSchema.tsx17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx
index e943b71e8..22756be24 100644
--- a/src/client/util/RichTextSchema.tsx
+++ b/src/client/util/RichTextSchema.tsx
@@ -321,8 +321,21 @@ export const marks: { [index: string]: MarkSpec } = {
}],
toDOM(node: any) {
return node.attrs.color ? ['span', { style: 'color:' + node.attrs.color }] : ['span', { style: 'color: black' }];
- // ["div", ["span", `"`], ["span", 0], ["span", `"`], ["br"], ["a", { ...node.attrs, class: "prosemirror-attribution" }, node.attrs.title], ["br"]] :
- // ["a", { ...node.attrs }, 0];
+ }
+ },
+
+ highlight2: {
+ attrs: {
+ highlight: { default: "transparent" }
+ },
+ inclusive: false,
+ parseDOM: [{
+ tag: "span", getAttrs(dom: any) {
+ return { highlight: dom.getAttribute("backgroundColor") };
+ }
+ }],
+ toDOM(node: any) {
+ return node.attrs.highlight ? ['span', { style: 'background-color:' + node.attrs.highlight }] : ['span', { style: 'background-color: transparent' }];
}
},