diff options
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)); } |