// Package docx is docforge's .docx (OOXML) adapter — the first // format adapter in the docforge engine (t-paliad-349 / m/paliad#157). // // It owns the in-house OOXML machinery extracted from paliad's submission // generator in slice 1, with no behaviour change: // // - merge.go — the placeholder substitution renderer // (SubmissionRenderer.Render / RenderHTML). Two-pass {{placeholder}} // substitution (single-run, then cross-run merge for fragmented // placeholders), plus the preview-HTML emitter that wraps substituted // values in clickable markup. // - markdown.go — the Markdown→OOXML walker (RenderMarkdownToOOXML*), // including the b78a984 fix that preserves {{…}} placeholders verbatim // through inline-span parsing (underscores in keys survive). // - dotm.go — ConvertDotmToDocx: strips macros from a .dotm/.docm/ // .dotx and rewrites the content-types + rels to a clean .docx, // passing every other part through bit-for-bit. // // Why no third-party docx library: lukasjarosch/go-docx treats sibling // placeholders in one run ("{{a}} ./. {{b}}") as nested and refuses to // replace either; patent submissions routinely have several placeholders // per paragraph, so this in-house renderer is required. See merge.go. // // The placeholder grammar — \{\{\s*([A-Za-z][A-Za-z0-9_.]*)\s*\}\} — and // the PlaceholderMap type currently live here with the renderer; a later // slice hoists the format-neutral grammar up to the docforge root once // the neutral document model and the VariableResolver interface land. package docx