aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-17 16:18:40 -0400
committerbobzel <zzzman@gmail.com>2020-09-17 16:18:40 -0400
commit88fbc391b3dd3f36a2e7015bc59c3a306d3e7d57 (patch)
tree7eebfa625ac358b96e43f133a8603aec874aa924 /src
parent7f7308720445c50c818fffb733a165ab651f5696 (diff)
from last again
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/formattedText/RichTextRules.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/formattedText/RichTextRules.ts b/src/client/views/nodes/formattedText/RichTextRules.ts
index 09f484e37..921c0e128 100644
--- a/src/client/views/nodes/formattedText/RichTextRules.ts
+++ b/src/client/views/nodes/formattedText/RichTextRules.ts
@@ -271,7 +271,7 @@ export class RichTextRules {
(state, match, start, end) => {
const fieldKey = match[1];
const rawdocid = match[3]?.substring(1);
- const docid = (!rawdocid.includes("@") ? Doc.CurrentUserEmail + "@" + rawdocid : rawdocid).replace(".", "_");
+ const docid = rawdocid ? (!rawdocid.includes("@") ? Doc.CurrentUserEmail + "@" + rawdocid : rawdocid).replace(".", "_") : undefined;
const value = match[2]?.substring(1);
if (!fieldKey) {
const linkId = Utils.GenerateGuid();
@@ -304,7 +304,7 @@ export class RichTextRules {
const fieldKey = match[1] || "";
const fieldParam = match[2]?.replace("…", "...") || "";
const rawdocid = match[3]?.substring(1);
- const docid = (!rawdocid.includes("@") ? Doc.CurrentUserEmail + "@" + rawdocid : rawdocid).replace(".", "_");
+ const docid = rawdocid ? (!rawdocid.includes("@") ? Doc.CurrentUserEmail + "@" + rawdocid : rawdocid).replace(".", "_") : undefined;
if (!fieldKey && !docid) return state.tr;
docid && DocServer.GetRefField(docid).then(docx => {
if (!(docx instanceof Doc && docx)) {