aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextRules.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-17 16:38:19 -0800
committerSam Wilkins <samwilkins333@gmail.com>2019-12-17 16:38:19 -0800
commit10843071eacf94b237d131a50df9c58352441814 (patch)
tree854ed4e91131d5f11c4526c0cd24056adf1de2e3 /src/client/util/RichTextRules.ts
parente553c4ac4785ee1d2c57ed5d5303d6dff26929f9 (diff)
parent96ada41d4c3c411be63bd656da65bba7894a4224 (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);