diff options
| author | Melissa Zhang <mzhang19096@gmail.com> | 2020-04-22 23:40:32 -0700 |
|---|---|---|
| committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-04-22 23:40:32 -0700 |
| commit | 4f3964ecaa67797237734deb4b2ae9aaaf77a940 (patch) | |
| tree | 04460478d173f56d3f2950fcf001ab63e000a9b8 /src/client/util/RichTextRules.ts | |
| parent | 13f182c2f138c25b0b57169dc94ecbfdd59483ef (diff) | |
| parent | d2682eba642d2f10e94822d9c9864a6477052e06 (diff) | |
fixed merge conflicts
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); |
