aboutsummaryrefslogtreecommitdiff
path: root/src/fields/RichTextUtils.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-16 08:45:10 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-16 08:45:10 -0400
commitec8b9aef9ef0ce0e4bbe268524b1c185b3074f1a (patch)
tree319a75df2bf0679f26ed24c9cccd0560f460b1eb /src/fields/RichTextUtils.ts
parent23d91c839bc7dd14fd906aa1b3c7b3cd16980dd4 (diff)
parent157e80d5ee76f1c2386e2cde69fcc13188d27d8b (diff)
Merge branch 'master' into RichTextEdition
Diffstat (limited to 'src/fields/RichTextUtils.ts')
-rw-r--r--src/fields/RichTextUtils.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fields/RichTextUtils.ts b/src/fields/RichTextUtils.ts
index c475d0d73..66959882d 100644
--- a/src/fields/RichTextUtils.ts
+++ b/src/fields/RichTextUtils.ts
@@ -3,7 +3,7 @@ import { docs_v1 } from "googleapis";
import { Fragment, Mark, Node } from "prosemirror-model";
import { sinkListItem } from "prosemirror-schema-list";
import { Utils } from "../Utils";
-import { Docs } from "../client/documents/Documents";
+import { Docs, DocUtils } from "../client/documents/Documents";
import { schema } from "../client/views/nodes/formattedText/schema_rts";
import { GooglePhotos } from "../client/apis/google_docs/GooglePhotosClientUtils";
import { DocServer } from "../client/DocServer";
@@ -272,7 +272,7 @@ export namespace RichTextUtils {
const backingDocId = StrCast(textNote[guid]);
if (!backingDocId) {
const backingDoc = Docs.Create.ImageDocument(agnostic, { _width: 300, _height: 300 });
- Doc.makeCustomViewClicked(backingDoc, Docs.Create.FreeformDocument);
+ DocUtils.makeCustomViewClicked(backingDoc, Docs.Create.FreeformDocument);
docid = backingDoc[Id];
textNote[guid] = docid;
} else {
@@ -392,7 +392,7 @@ export namespace RichTextUtils {
const { attrs } = mark;
switch (converted) {
case "link":
- let url = attrs.href;
+ let url = attrs.allHrefs.length ? attrs.allHrefs[0].href : "";
const delimiter = "/doc/";
const alreadyShared = "?sharing=true";
if (new RegExp(window.location.origin + delimiter).test(url) && !url.endsWith(alreadyShared)) {
@@ -401,7 +401,7 @@ export namespace RichTextUtils {
let exported = (await Cast(linkDoc.anchor2, Doc))!;
if (!exported.customLayout) {
exported = Doc.MakeAlias(exported);
- Doc.makeCustomViewClicked(exported, Docs.Create.FreeformDocument);
+ DocUtils.makeCustomViewClicked(exported, Docs.Create.FreeformDocument);
linkDoc.anchor2 = exported;
}
url = Utils.shareUrl(exported[Id]);