aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-02-01 10:41:35 -0500
committerbobzel <zzzman@gmail.com>2024-02-01 10:41:35 -0500
commit9e0de1f1ee32511cf5c9b3b19accad354c3fda92 (patch)
tree975e02b4b15b86a0eb50472d2bcf609ad24e9bd7 /src/fields
parent0d8c05db9cbb5a23a94554c65015c347ff8c38b9 (diff)
enabled lists to be entered via dashfieldview. changed code/text import to allow data to be inserted into template.
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index f3fc51671..ab6d0390b 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -67,7 +67,10 @@ export namespace Field {
// as a kind of macro to include the content of those documents
Doc.MyPublishedDocs.forEach(doc => {
const regex = new RegExp(`^\\^${doc.title}\\s`, 'm');
- script = script.replace(regex, Cast(doc.text, RichTextField, null)?.Text ?? '');
+ const sections = (Cast(doc.text, RichTextField, null)?.Text ?? '').split('--DOCDATA--');
+ if (script.match(regex)) {
+ script = script.replace(regex, sections[0]) + (sections.length > 1 ? sections[1] : '');
+ }
});
return script;
}