-
-
-
- Briefing
-
+
{briefing.map((entry, index) => (
-
{entry.sectionName}
+
-
+ {entry.details ? (
+
+ ) : (
+
No details.
+ )}
))}
diff --git a/src/components/frontend/intelligence/SideOpNarrativeFields.tsx b/src/components/frontend/intelligence/SideOpNarrativeFields.tsx
index f486947f..d974a23f 100644
--- a/src/components/frontend/intelligence/SideOpNarrativeFields.tsx
+++ b/src/components/frontend/intelligence/SideOpNarrativeFields.tsx
@@ -102,6 +102,7 @@ export function SideOpNarrativeFields({ value, onChange }: SideOpNarrativeFields
setBriefing(next);
}}
placeholder="Briefing text for this section"
+ showTextColor
/>
))}
diff --git a/src/lib/intelligence/briefingConverters.tsx b/src/lib/intelligence/briefingConverters.tsx
new file mode 100644
index 00000000..8d0a3ed9
--- /dev/null
+++ b/src/lib/intelligence/briefingConverters.tsx
@@ -0,0 +1,17 @@
+import type { JSXConvertersFunction } from "@payloadcms/richtext-lexical/react";
+import { briefingTextColor } from "./briefingSqf";
+
+/**
+ * Payload's default text converter ignores both TextStateFeature state and the
+ * inline `style` string, so briefing colors would silently disappear on the
+ * page. Wrap the default converter in a colored span when the node has one.
+ */
+export const briefingConverters: JSXConvertersFunction = ({ defaultConverters }) => ({
+ ...defaultConverters,
+ text: (args) => {
+ const base = defaultConverters.text;
+ const rendered = typeof base === "function" ? base(args) : null;
+ const color = briefingTextColor(args.node);
+ return color && rendered !== null ?
{rendered} : rendered;
+ },
+});
diff --git a/src/lib/intelligence/briefingSqf.ts b/src/lib/intelligence/briefingSqf.ts
new file mode 100644
index 00000000..0aeafe2b
--- /dev/null
+++ b/src/lib/intelligence/briefingSqf.ts
@@ -0,0 +1,420 @@
+/**
+ * Converts Payload Lexical briefing content into Arma 3 Structured Text and
+ * ready-to-paste SQF. Pure module (client-safe, no Payload imports).
+ *
+ * Formatting map:
+ * bold ->
+ * underline ->
+ * inline code ->
+ * color ->
+ * italic -> plain text (Arma 3 ships no italic face)
+ * strike -> plain text (no Structured Text equivalent)
+ * sub/sup -> plain text (no Structured Text equivalent)
+ *
+ * Blocks: paragraphs and headings, ordered/bullet/check lists (including
+ * nesting), quotes, horizontal rules, and block alignment/indent. Images and
+ * links become readable placeholders rather than tags Arma cannot load.
+ */
+
+export interface BriefingSqfEntry {
+ sectionName: string;
+ details: unknown;
+}
+
+export interface BriefingTextColor {
+ hex: string;
+ label: string;
+}
+
+/**
+ * Palette shared by the Lexical editor (TextStateFeature) and the exporter.
+ * Keep the keys stable: they are persisted inside briefing JSON.
+ */
+export const BRIEFING_TEXT_COLORS = {
+ red: { hex: "#ff5c5c", label: "Red" },
+ orange: { hex: "#ff9f43", label: "Orange" },
+ yellow: { hex: "#ffd93d", label: "Yellow" },
+ green: { hex: "#4ade80", label: "Green" },
+ blue: { hex: "#60a5fa", label: "Blue" },
+ purple: { hex: "#c084fc", label: "Purple" },
+ pink: { hex: "#f472b6", label: "Pink" },
+ gray: { hex: "#9ca3af", label: "Gray" },
+ white: { hex: "#ffffff", label: "White" },
+} as const satisfies Record;
+
+type BriefingTextColorKey = keyof typeof BRIEFING_TEXT_COLORS;
+
+interface LexicalNode {
+ type?: string;
+ text?: unknown;
+ children?: unknown;
+ format?: unknown;
+ indent?: unknown;
+ listType?: unknown;
+ tag?: unknown;
+ start?: unknown;
+ checked?: unknown;
+ color?: unknown;
+ style?: unknown;
+ fields?: unknown;
+ url?: unknown;
+ value?: unknown;
+ relationTo?: unknown;
+ [key: string]: unknown;
+}
+
+const FORMAT_BOLD = 1;
+const FORMAT_UNDERLINE = 8;
+const FORMAT_CODE = 16;
+
+const MUTED = "#9ca3af";
+const RULE = "#6b7280";
+
+/** CSS named colors Arma can render, for legacy/AI-authored `style` values. */
+const NAMED_COLORS: Record = {
+ red: "#ff0000",
+ orange: "#ff8c00",
+ yellow: "#ffff00",
+ green: "#00ff00",
+ blue: "#0000ff",
+ purple: "#800080",
+ pink: "#ffc0cb",
+ gray: "#808080",
+ grey: "#808080",
+ white: "#ffffff",
+ black: "#000000",
+ cyan: "#00ffff",
+};
+
+function isNode(value: unknown): value is LexicalNode {
+ return typeof value === "object" && value !== null && !Array.isArray(value);
+}
+
+function childrenOf(node: LexicalNode | null | undefined): unknown[] {
+ return Array.isArray(node?.children) ? node.children : [];
+}
+
+function stringOf(value: unknown): string | null {
+ return typeof value === "string" && value.length > 0 ? value : null;
+}
+
+/** Escape characters that would otherwise be parsed as Structured Text tags. */
+function escapeText(value: string): string {
+ return value
+ .replace(/&/g, "&")
+ .replace(//g, ">")
+ .replace(/\r\n?/g, "\n")
+ .replace(/\n/g, "
");
+}
+
+/** Escape a value for the inside of a SQF double-quoted string. */
+function sqfString(value: string): string {
+ return `"${value.replace(/"/g, '""')}"`;
+}
+
+function normalizeHex(value: string): string | null {
+ const trimmed = value.trim().toLowerCase();
+ if (!/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(trimmed)) return null;
+ if (trimmed.length === 4) {
+ return `#${trimmed[1]}${trimmed[1]}${trimmed[2]}${trimmed[2]}${trimmed[3]}${trimmed[3]}`;
+ }
+ return trimmed;
+}
+
+/** Browsers serialize inline styles as `rgb()` / `rgba()`, so accept those too. */
+function rgbToHex(value: string): string | null {
+ const match = value
+ .trim()
+ .match(
+ /^rgba?\(\s*(\d{1,3})\s*[, ]\s*(\d{1,3})\s*[, ]\s*(\d{1,3})(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i,
+ );
+ if (!match) return null;
+ const channels = match.slice(1, 4).map(Number);
+ if (channels.some((channel) => channel < 0 || channel > 255)) return null;
+ return `#${channels.map((channel) => channel.toString(16).padStart(2, "0")).join("")}`;
+}
+
+function colorFromStyle(style: string): string | null {
+ const match = style.match(/(?:^|;)\s*color\s*:\s*([^;]+)/i);
+ if (!match) return null;
+ const value = match[1].trim();
+ return normalizeHex(value) ?? rgbToHex(value) ?? NAMED_COLORS[value.toLowerCase()] ?? null;
+}
+
+/**
+ * Resolves a text node's color from the inline `style` string (front-end
+ * editor), the top-level `color` key, or Payload's TextStateFeature state,
+ * which Lexical serializes under `$` (admin editor). Only colors Arma
+ * understands are returned; everything else falls back to default.
+ */
+export function briefingTextColor(node: {
+ color?: unknown;
+ style?: unknown;
+ $?: unknown;
+}): string | null {
+ const style = stringOf(node.style);
+ const styleColor = style ? colorFromStyle(style) : null;
+ if (styleColor) return styleColor;
+
+ const state = isNode(node.$) ? node.$ : null;
+ const raw = stringOf(node.color) ?? (state ? stringOf(state.color) : null);
+ if (!raw) return null;
+
+ const palette = BRIEFING_TEXT_COLORS[raw as BriefingTextColorKey];
+ if (palette) return palette.hex;
+ const hex = normalizeHex(raw);
+ if (hex) return hex;
+ return NAMED_COLORS[raw.toLowerCase()] ?? null;
+}
+
+function textAttributes(node: LexicalNode): string[] {
+ const attrs: string[] = [];
+ const format = typeof node.format === "number" ? node.format : 0;
+ const bold = (format & FORMAT_BOLD) !== 0;
+ const code = (format & FORMAT_CODE) !== 0;
+
+ if (code) attrs.push("font='EtelkaMonospacePro'");
+ else if (bold) attrs.push("font='PuristaBold'");
+ if ((format & FORMAT_UNDERLINE) !== 0) attrs.push("underline='1'");
+
+ const color = briefingTextColor(node);
+ if (color) attrs.push(`color='${color}'`);
+ return attrs;
+}
+
+function wrapText(value: string, attrs: string[]): string {
+ if (attrs.length === 0) return value;
+ return `${value}`;
+}
+
+function renderText(node: LexicalNode): string {
+ const text = typeof node.text === "string" ? node.text : "";
+ if (text.length === 0) return "";
+ return wrapText(escapeText(text), textAttributes(node));
+}
+
+function renderInline(nodes: unknown[]): string {
+ return nodes.map((child) => renderNode(child)).join("");
+}
+
+function indentFor(node: LexicalNode): string {
+ const indent = typeof node.indent === "number" ? Math.max(0, node.indent) : 0;
+ return "\u00a0".repeat(indent * 4);
+}
+
+/** Wrap a block in alignment/indent attributes when it asks for them. */
+function renderBlock(node: LexicalNode, content: string): string {
+ if (content.length === 0) return "";
+ const indent = indentFor(node);
+ const align = typeof node.format === "string" ? node.format : "";
+ if (align === "center" || align === "right") {
+ return `${indent}${content}`;
+ }
+ return `${indent}${content}`;
+}
+
+const HEADING_SIZES: Record = {
+ h1: "1.5",
+ h2: "1.35",
+ h3: "1.2",
+ h4: "1.1",
+ h5: "1.0",
+ h6: "0.95",
+};
+
+function renderHeading(node: LexicalNode): string {
+ const content = renderInline(childrenOf(node));
+ if (content.length === 0) return "";
+ const tag = typeof node.tag === "string" ? node.tag : "h2";
+ const size = HEADING_SIZES[tag] ?? "1.2";
+ return renderBlock(node, wrapText(content, ["font='PuristaBold'", `size='${size}'`]));
+}
+
+function renderList(node: LexicalNode, depth = 0): string {
+ const items = childrenOf(node).filter(
+ (child): child is LexicalNode => isNode(child) && child.type === "listitem",
+ );
+ if (items.length === 0) return "";
+
+ const ordered = node.listType === "number" || node.tag === "ol";
+ const check = node.listType === "check" || node.listType === "checklist";
+ const start = typeof node.start === "number" && node.start > 0 ? node.start : 1;
+ const indent = "\u00a0".repeat(depth * 4);
+
+ return items
+ .map((item, index) => {
+ const itemChildren = childrenOf(item);
+ const nested = itemChildren.filter(
+ (child): child is LexicalNode => isNode(child) && child.type === "list",
+ );
+ const inline = renderInline(
+ itemChildren.filter((child) => !isNode(child) || child.type !== "list"),
+ );
+
+ const marker = check
+ ? item.checked === true
+ ? "[x] "
+ : "[ ] "
+ : ordered
+ ? `${start + index}. `
+ : "\u2022 ";
+
+ const line = `${indent}${marker}${inline}`;
+ const nestedText = nested
+ .map((child) => renderList(child, depth + 1))
+ .filter((text) => text.length > 0)
+ .join("
");
+ return nestedText.length > 0 ? `${line}
${nestedText}` : line;
+ })
+ .join("
");
+}
+
+function renderUpload(node: LexicalNode): string {
+ const value = isNode(node.value) ? node.value : null;
+ const label =
+ (value ? stringOf(value.filename) : null) ??
+ (value ? stringOf(value.url) : null) ??
+ stringOf(node.relationTo) ??
+ "embedded media";
+ return wrapText(`[Image: ${escapeText(label)}]`, [`color='${MUTED}'`]);
+}
+
+function renderLink(node: LexicalNode): string {
+ const fields = isNode(node.fields) ? node.fields : null;
+ const url = (fields ? stringOf(fields.url) : null) ?? stringOf(node.url);
+ const label = renderInline(childrenOf(node));
+ const text = label.length > 0 ? label : url ? escapeText(url) : "";
+ if (!url || text.includes(escapeText(url))) return text;
+ return `${text} (${escapeText(url)})`;
+}
+
+function renderNode(value: unknown): string {
+ if (!isNode(value)) return "";
+ const type = typeof value.type === "string" ? value.type : "";
+
+ switch (type) {
+ case "text":
+ return renderText(value);
+ case "linebreak":
+ return "
";
+ case "tab":
+ return "\u00a0\u00a0\u00a0\u00a0";
+ case "paragraph":
+ return renderBlock(value, renderInline(childrenOf(value)));
+ case "heading":
+ return renderHeading(value);
+ case "list":
+ return renderList(value);
+ case "listitem":
+ return renderInline(childrenOf(value));
+ case "quote":
+ case "blockquote":
+ return renderBlock(
+ value,
+ wrapText(`| ${renderBlockChildren(childrenOf(value))}`, [`color='${MUTED}'`]),
+ );
+ case "horizontalrule":
+ return wrapText("-----", [`color='${RULE}'`]);
+ case "link":
+ case "autolink":
+ return renderLink(value);
+ case "upload":
+ return renderUpload(value);
+ case "relationship":
+ return wrapText("[Reference]", [`color='${MUTED}'`]);
+ case "root":
+ return renderBlockChildren(childrenOf(value));
+ default:
+ return childrenOf(value).length > 0 ? renderInline(childrenOf(value)) : "";
+ }
+}
+
+function renderBlockChildren(nodes: unknown[]): string {
+ return nodes
+ .map((child) => renderNode(child))
+ .filter((text) => text.length > 0)
+ .join("
");
+}
+
+function renderRoot(details: unknown): string {
+ if (!isNode(details)) return "";
+ const root = isNode(details.root) ? details.root : null;
+ return root ? renderBlockChildren(childrenOf(root)) : "";
+}
+
+function entryTitle(entry: BriefingSqfEntry): string {
+ return wrapText(escapeText(entry.sectionName), ["font='PuristaBold'", "size='1.2'"]);
+}
+
+/**
+ * Structured Text body for one briefing entry. Titles are optional because the
+ * diary script already carries the section name as the record title.
+ */
+export function briefingEntryToStructuredText(
+ entry: BriefingSqfEntry,
+ options: { includeTitle?: boolean } = {},
+): string {
+ const body = renderRoot(entry.details);
+ if (options.includeTitle !== true) return body;
+ const title = entryTitle(entry);
+ return body.length > 0 ? `${title}
${body}` : title;
+}
+
+export function briefingEntryHasContent(entry: BriefingSqfEntry): boolean {
+ return renderRoot(entry.details).trim().length > 0;
+}
+
+function commentSafe(value: string): string {
+ return value.replace(/\*\//g, "* /");
+}
+
+/**
+ * A `createDiaryRecord` script that recreates every briefing entry in the
+ * player's diary. Records are emitted in reverse because Arma inserts each new
+ * record above the previous one, so the script reads top-to-bottom in order.
+ */
+export function briefingToDiarySqf(
+ entries: BriefingSqfEntry[],
+ options: { missionName?: string | null } = {},
+): string {
+ const mission = options.missionName?.trim();
+ const lines: string[] = [
+ `// Generated by Polaris Task Force${mission ? ` - briefing for "${commentSafe(mission)}"` : " - mission briefing"}.`,
+ "// Paste into the debug console or a mission init file. Records are added",
+ "// bottom-up so they read in order in the game's diary.",
+ "",
+ ];
+
+ for (const entry of [...entries].reverse()) {
+ const body = briefingEntryToStructuredText(entry);
+ lines.push(
+ `player createDiaryRecord ["Diary", [${sqfString(entry.sectionName)}, ${sqfString(body)}]];`,
+ );
+ }
+
+ return `${lines.join("\n")}\n`;
+}
+
+/**
+ * A `_briefing` array of Structured Text bodies (titles included), one element
+ * per entry, ready to feed into your own diary or hint code.
+ */
+export function briefingToStructuredTextSqf(entries: BriefingSqfEntry[]): string {
+ const lines: string[] = [
+ `// Generated by Polaris Task Force (${entries.length} briefing section${entries.length === 1 ? "" : "s"}).`,
+ "// Each element is a Structured Text body, ready for createDiaryRecord.",
+ "",
+ "private _briefing = [",
+ ];
+
+ entries.forEach((entry, index) => {
+ const body = briefingEntryToStructuredText(entry, { includeTitle: true });
+ const comma = index < entries.length - 1 ? "," : "";
+ lines.push(` /* ${commentSafe(entry.sectionName)} */`);
+ lines.push(` ${sqfString(body)}${comma}`);
+ });
+
+ lines.push("];");
+ return `${lines.join("\n")}\n`;
+}
diff --git a/tests/int/briefing-sqf.int.spec.ts b/tests/int/briefing-sqf.int.spec.ts
new file mode 100644
index 00000000..386057c9
--- /dev/null
+++ b/tests/int/briefing-sqf.int.spec.ts
@@ -0,0 +1,250 @@
+import { createElement } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import { RichText } from "@payloadcms/richtext-lexical/react";
+import { describe, expect, it } from "vitest";
+import { briefingConverters } from "@/lib/intelligence/briefingConverters";
+import {
+ briefingEntryHasContent,
+ briefingEntryToStructuredText,
+ briefingToDiarySqf,
+ briefingToStructuredTextSqf,
+ type BriefingSqfEntry,
+} from "@/lib/intelligence/briefingSqf";
+
+function text(value: string, format = 0, extra: Record = {}) {
+ return { type: "text", version: 1, text: value, format, ...extra };
+}
+
+function paragraph(children: unknown[], extra: Record = {}) {
+ return { type: "paragraph", version: 1, children, ...extra };
+}
+
+function entry(sectionName: string, children: unknown[]): BriefingSqfEntry {
+ return {
+ sectionName,
+ details: {
+ root: { type: "root", version: 1, children },
+ },
+ };
+}
+
+describe("briefing Structured Text conversion", () => {
+ it("maps bold, underline, code, and color formats", () => {
+ const result = briefingEntryToStructuredText(
+ entry("Situation", [
+ paragraph([
+ text("bold", 1),
+ text(" "),
+ text("under", 8),
+ text(" "),
+ text("code", 16),
+ text(" "),
+ text("red", 0, { color: "red" }),
+ text(" "),
+ text("both", 1, { color: "blue" }),
+ ]),
+ ]),
+ );
+
+ expect(result).toContain("bold");
+ expect(result).toContain("under");
+ expect(result).toContain("code");
+ expect(result).toContain("red");
+ expect(result).toContain("both");
+ });
+
+ it("keeps text Arma cannot style as plain text", () => {
+ const result = briefingEntryToStructuredText(
+ entry("Situation", [paragraph([text("italic", 2), text(" "), text("crossed", 4)])]),
+ );
+
+ expect(result).toBe("italic crossed");
+ });
+
+ it("resolves legacy CSS style colors and ignores unknowns", () => {
+ const result = briefingEntryToStructuredText(
+ entry("Situation", [
+ paragraph([
+ text("style", 0, { style: "color: #ff0000;" }),
+ text(" "),
+ text("browser", 0, { style: "color: rgb(255, 159, 67)" }),
+ text(" "),
+ text("state", 0, { $: { color: "red" } }),
+ text(" "),
+ text("unknown", 0, { color: "chartreuse" }),
+ ]),
+ ]),
+ );
+
+ expect(result).toBe(
+ "style browser state unknown",
+ );
+ });
+
+ it("escapes Structured Text metacharacters", () => {
+ const result = briefingEntryToStructuredText(
+ entry("Situation", [paragraph([text(" & Bravo")])]),
+ );
+
+ expect(result).toBe("<Alpha> & Bravo");
+ });
+
+ it("renders headings with size and alignment", () => {
+ const heading = {
+ type: "heading",
+ version: 1,
+ tag: "h2",
+ children: [text("Orders")],
+ };
+ const centered = paragraph([text("Centered")], { format: "center" });
+
+ const result = briefingEntryToStructuredText(entry("Mission", [heading, centered]));
+
+ expect(result).toContain("Orders");
+ expect(result).toContain("Centered");
+ });
+
+ it("renders bullet, numbered, checklist, and nested lists", () => {
+ const list = {
+ type: "list",
+ version: 1,
+ listType: "number",
+ tag: "ol",
+ start: 3,
+ children: [
+ {
+ type: "listitem",
+ version: 1,
+ value: 1,
+ children: [
+ text("First"),
+ {
+ type: "list",
+ version: 1,
+ listType: "bullet",
+ tag: "ul",
+ children: [{ type: "listitem", version: 1, value: 1, children: [text("Nested")] }],
+ },
+ ],
+ },
+ { type: "listitem", version: 1, value: 2, children: [text("Second")] },
+ ],
+ };
+ const checklist = {
+ type: "list",
+ version: 1,
+ listType: "check",
+ tag: "ul",
+ children: [
+ { type: "listitem", version: 1, checked: true, children: [text("Done")] },
+ { type: "listitem", version: 1, checked: false, children: [text("Todo")] },
+ ],
+ };
+
+ const result = briefingEntryToStructuredText(entry("Execution", [list, checklist]));
+
+ expect(result).toContain("3. First
\u00a0\u00a0\u00a0\u00a0\u2022 Nested");
+ expect(result).toContain("4. Second");
+ expect(result).toContain("[x] Done
[ ] Todo");
+ });
+
+ it("renders quotes, rules, links, and images as readable placeholders", () => {
+ const quote = {
+ type: "quote",
+ version: 1,
+ children: [text("Hold the line")],
+ };
+ const rule = { type: "horizontalrule", version: 1 };
+ const link = {
+ type: "link",
+ version: 1,
+ fields: { url: "https://example.test/opord" },
+ children: [text("OPORD")],
+ };
+ const image = {
+ type: "upload",
+ version: 1,
+ relationTo: "media",
+ value: { filename: "map.jpg", url: "/media/map.jpg" },
+ };
+
+ const result = briefingEntryToStructuredText(entry("Signals", [quote, rule, link, image]));
+
+ expect(result).toContain("| Hold the line");
+ expect(result).toContain("-----");
+ expect(result).toContain("OPORD (https://example.test/opord)");
+ expect(result).toContain("[Image: map.jpg]");
+ });
+
+ it("detects entries with no body text", () => {
+ expect(briefingEntryHasContent(entry("Empty", [paragraph([])]))).toBe(false);
+ expect(briefingEntryHasContent(entry("Full", [paragraph([text("Hi")])]))).toBe(true);
+ expect(briefingEntryHasContent({ sectionName: "Bad", details: null })).toBe(false);
+ });
+
+ it("renders colors on the mission page", () => {
+ const data = {
+ root: {
+ type: "root",
+ version: 1,
+ direction: null,
+ format: "",
+ indent: 0,
+ children: [
+ {
+ type: "paragraph",
+ version: 1,
+ direction: null,
+ format: "",
+ indent: 0,
+ textFormat: 0,
+ children: [
+ text("Red alert", 1, { $: { color: "red" } }),
+ text(" and "),
+ text("styled", 0, { style: "color: rgb(96, 165, 250)" }),
+ ],
+ },
+ ],
+ },
+ };
+
+ const html = renderToStaticMarkup(
+ createElement(RichText, { data: data as never, converters: briefingConverters }),
+ );
+
+ expect(html).toMatch(/Red alert<\/strong><\/span>/);
+ expect(html).toMatch(/styled<\/span>/);
+ });
+});
+
+describe("briefing SQF export", () => {
+ const situation = entry("Situation", [paragraph([text("Enemy to the north.")])]);
+ const mission = entry("Mission", [paragraph([text("Take the ridge.")])]);
+
+ it("creates diary records bottom-up so they read in order", () => {
+ const sqf = briefingToDiarySqf([situation, mission], { missionName: "The Pale" });
+
+ expect(sqf).toContain('player createDiaryRecord ["Diary", ["Situation",');
+ expect(sqf).toContain('player createDiaryRecord ["Diary", ["Mission",');
+ expect(sqf.indexOf('["Mission"')).toBeLessThan(sqf.indexOf('["Situation"'));
+ expect(sqf).toContain('briefing for "The Pale"');
+ });
+
+ it("doubles quotes inside SQF strings", () => {
+ const quoted = entry('Signals "Main"', [paragraph([text('Say "hello".')])]);
+ const sqf = briefingToDiarySqf([quoted]);
+
+ expect(sqf).toContain('["Signals ""Main"""');
+ expect(sqf).toContain('""hello""');
+ });
+
+ it("exports an array of Structured Text bodies with titles", () => {
+ const sqf = briefingToStructuredTextSqf([situation, mission]);
+
+ expect(sqf).toContain("private _briefing = [");
+ expect(sqf).toContain("Situation");
+ expect(sqf).toContain("Mission");
+ expect(sqf).toMatch(/take the ridge\."\n\]/i);
+ expect(sqf).toContain("Take the ridge.");
+ });
+});