diff options
author | A.J. Shulman <Shulman.aj@gmail.com> | 2024-10-17 17:41:49 -0400 |
---|---|---|
committer | A.J. Shulman <Shulman.aj@gmail.com> | 2024-10-17 17:41:49 -0400 |
commit | c933ae724c1bf77fa8bd83c3c9e27d0029ef5cb0 (patch) | |
tree | df16f68e9bdb822e5f91c997a431c4b130377290 /src/fields/Doc.ts | |
parent | 98d0bba3e59ab7ec9dfbf5e6c9c58e6ac1d22ae3 (diff) | |
parent | dd93f5175064850c6c0e47f025cd7bbba1f23106 (diff) |
Merge branch 'ajs-before-executable' of https://github.com/brown-dash/Dash-Web into ajs-before-executable
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 81241f9fe..6ec195910 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -960,6 +960,19 @@ export namespace Doc { } } else if (field instanceof PrefetchProxy) { Doc.FindReferences(field.value, references, system); + } else if (field instanceof RichTextField) { + const re = /"docId"\s*:\s*"(.*?)"/g; + let match: string[] | null; + while ((match = re.exec(field.Data)) !== null) { + const urlString = match[1]; + if (urlString) { + const rdoc = DocServer.GetCachedRefField(urlString); + if (rdoc) { + references.add(rdoc); + Doc.FindReferences(rdoc, references, system); + } + } + } } } else if (field instanceof Promise) { // eslint-disable-next-line no-debugger @@ -990,7 +1003,7 @@ export namespace Doc { } else if (field instanceof ObjectField) { const docAtKey = doc[key]; copy[key] = - docAtKey instanceof Doc && key.includes('layout[') + docAtKey instanceof Doc && (key.includes('layout[') || docAtKey.cloneOnCopy) ? new ProxyField(Doc.MakeCopy(docAtKey)) // copy the expanded render template : ObjectField.MakeCopy(field); } else if (field instanceof Promise) { |