diff options
author | bobzel <zzzman@gmail.com> | 2021-09-24 01:21:38 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-24 01:21:38 -0400 |
commit | 643df77e6366b7164307ffe195ed9de83b68e5ae (patch) | |
tree | edf5ce846fbbdb84ccd015b18b07314cb24c76b8 /src/fields/RichTextUtils.ts | |
parent | 815899626d82972ae56918487ee3ece11446d5a6 (diff) |
wrapped Color() calls in DashColor() to catch exceptions for color strings no found
Diffstat (limited to 'src/fields/RichTextUtils.ts')
-rw-r--r-- | src/fields/RichTextUtils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fields/RichTextUtils.ts b/src/fields/RichTextUtils.ts index 0b5f14d74..a19be5df9 100644 --- a/src/fields/RichTextUtils.ts +++ b/src/fields/RichTextUtils.ts @@ -2,7 +2,7 @@ import { AssertionError } from "assert"; import { docs_v1 } from "googleapis"; import { Fragment, Mark, Node } from "prosemirror-model"; import { sinkListItem } from "prosemirror-schema-list"; -import { Utils } from "../Utils"; +import { Utils, DashColor } from "../Utils"; import { Docs, DocUtils } from "../client/documents/Documents"; import { schema } from "../client/views/nodes/formattedText/schema_rts"; import { GooglePhotos } from "../client/apis/google_docs/GooglePhotosClientUtils"; @@ -482,7 +482,7 @@ export namespace RichTextUtils { } const fromHex = (color: string): docs_v1.Schema$OptionalColor => { - const c = Color(color); + const c = DashColor(color); return fromRgb.convert(c.red(), c.green(), c.blue()); }; |