aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextRules.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-04-15 19:10:09 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-04-15 19:10:09 -0400
commite0f16b89cba102a4fcd156bb3d4148432eca2ab7 (patch)
treec19d38e5bde3cb769af7099f3708f32237674c8f /src/client/util/RichTextRules.ts
parent5bd48845753f66f00b520f193d008e3a53fde6e3 (diff)
removed lock icon from top-level documents. made schema functions compile without typechecking. metadata #'s starting with a # are now numbers.
Diffstat (limited to 'src/client/util/RichTextRules.ts')
-rw-r--r--src/client/util/RichTextRules.ts3
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);