From 9e0de1f1ee32511cf5c9b3b19accad354c3fda92 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 1 Feb 2024 10:41:35 -0500 Subject: enabled lists to be entered via dashfieldview. changed code/text import to allow data to be inserted into template. --- src/fields/Doc.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/fields') 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; } -- cgit v1.2.3-70-g09d2