diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-12-10 18:47:27 -0500 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-12-10 18:47:27 -0500 |
commit | 4ab742c54d600fb62b02268f48e711258558924b (patch) | |
tree | fbda9419f1941097d935c035f67a19470f807587 /src | |
parent | 65c7ce1c6be70f28e1be57e369cf15bc2df7d729 (diff) |
fixes to color marks
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/RichTextSchema.tsx | 2 | ||||
-rw-r--r-- | src/client/util/TooltipTextMenu.tsx | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx index 7cb8448ca..4369be1ee 100644 --- a/src/client/util/RichTextSchema.tsx +++ b/src/client/util/RichTextSchema.tsx @@ -313,7 +313,7 @@ export const marks: { [index: string]: MarkSpec } = { attrs: { color: { default: "#000" } }, - inclusive: false, + inclusive: true, parseDOM: [{ tag: "span", getAttrs(dom: any) { return { color: dom.getAttribute("color") }; diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx index 01d566831..f29dbf2e4 100644 --- a/src/client/util/TooltipTextMenu.tsx +++ b/src/client/util/TooltipTextMenu.tsx @@ -839,9 +839,11 @@ export class TooltipTextMenu { } public static insertColor(color: String, state: EditorState<any>, dispatch: any) { - if (state.selection.empty) return false; - const colorMark = state.schema.mark(state.schema.marks.pFontColor, { color: color }); + if (state.selection.empty) { + dispatch(state.tr.addStoredMark(colorMark)); + return false; + } dispatch(state.tr.addMark(state.selection.from, state.selection.to, colorMark)); } |