diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-18 17:56:30 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-18 17:56:30 -0500 |
commit | 04e2cdc30dd71cccb066f713a93cdc4d3bbd169c (patch) | |
tree | ebacc25b4b99ac74b4bf79c12d0ae17a46033b0b /src/client/util/RichTextRules.ts | |
parent | a261ab5e9697277bec029803f1fa0c890f0c8fd5 (diff) | |
parent | 9f8e76451b807ed8f51ef32aab9b2255dfccd525 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into script_documents
Diffstat (limited to 'src/client/util/RichTextRules.ts')
-rw-r--r-- | src/client/util/RichTextRules.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/util/RichTextRules.ts b/src/client/util/RichTextRules.ts index 6bbe81115..3746199ba 100644 --- a/src/client/util/RichTextRules.ts +++ b/src/client/util/RichTextRules.ts @@ -110,7 +110,8 @@ export class RichTextRules { return state.tr; } if (value !== "" && value !== undefined) { - this.Document[DataSym][fieldKey] = value === "true" ? true : value === "false" ? false : value; + const num = value.match(/^[0-9.]/); + this.Document[DataSym][fieldKey] = value === "true" ? true : value === "false" ? false : (num ? Number(value) : value); } const fieldView = state.schema.nodes.dashField.create({ fieldKey, docid }); return state.tr.deleteRange(start, end).insert(start, fieldView); |