aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-12-14 21:49:09 -0500
committerBob Zeleznik <zzzman@gmail.com>2019-12-14 21:49:09 -0500
commit7edce1af91621b7724e4763a5afabb4ab86d183c (patch)
treeed7a8b4a782b620621bb996ad5381e5f8ec57336 /src/client/util
parent56e384f2d97d2c399adf21fcf58143773fe3fd53 (diff)
make %@ portal hyperlink creation create a link as well.
Diffstat (limited to 'src/client/util')
-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);