aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextRules.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-12-16 10:40:45 -0500
committerbob <bcz@cs.brown.edu>2019-12-16 10:40:45 -0500
commit9c3acfbd6ad518cd1afcc05a521480d93c07f13a (patch)
treea6c6bbbfc2250e7c6d1f1d4b9757e55128597edf /src/client/util/RichTextRules.ts
parent7584c5bed0de45f2f656fb289ff67463fb1958ef (diff)
parent001cea83f6c57914e0e76a75a94f3e06e542a419 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/util/RichTextRules.ts')
-rw-r--r--src/client/util/RichTextRules.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/util/RichTextRules.ts b/src/client/util/RichTextRules.ts
index 364c85165..f5dd459fc 100644
--- a/src/client/util/RichTextRules.ts
+++ b/src/client/util/RichTextRules.ts
@@ -85,8 +85,9 @@ export const inpRules = {
const value = state.doc.textBetween(start, end);
if (value) {
DocServer.GetRefField(value).then(docx => {
- const doc = ((docx instanceof Doc) && docx) || Docs.Create.FreeformDocument([], { title: value, width: 500, height: 500 }, value);
- DocUtils.Publish(doc, value, returnFalse, returnFalse);
+ const target = ((docx instanceof Doc) && docx) || Docs.Create.FreeformDocument([], { title: value, width: 500, height: 500 }, value);
+ DocUtils.Publish(target, value, returnFalse, returnFalse);
+ DocUtils.MakeLink({ doc: (schema as any).Document }, { doc: target }, "portal link", "");
});
const link = state.schema.marks.link.create({ href: Utils.prepend("/doc/" + value), location: "onRight", title: value });
return state.tr.addMark(start, end, link);