Safely Editing Tags in Word
Tag Templates are ordinary Word documents, so it is tempting to edit the tags the way you would edit any other text. A few habits from normal Word editing will quietly corrupt a tag. This article covers what to watch for so an edit doesn’t break the whole document.
If you are new to tags, read What Are Tag Templates? first. This article assumes you already know what a tag looks like.
A tag has to live on one line — never press Enter inside it
A tag is a single unit that starts with \{ and ends with \}. Word does not know that. If your cursor is inside a tag and you press Enter, Word splits the tag across two paragraphs, and the merge engine can no longer read it as one tag. The result is a tag that appears in the finished document unreplaced.
The same thing happens invisibly when a tag falls at the end of a line and Word wraps it, or when you paste a tag from another document that carried a hidden paragraph mark. Keep every tag on a single line, and if a tag seems to have stopped working after an edit, turn on Word’s paragraph marks (the ¶ button on the Home tab) and check that no paragraph break landed inside it.
To change a tag, select the whole thing including the braces and retype it in one pass
The reliable way to edit a tag is to select from the opening \{ through the closing \} — braces included — and type the replacement in a single go. Do not click into the middle of a tag and edit a word or two.
Word records text as a series of runs, and clicking into the middle of a tag to edit it often leaves the tag split across several runs even though it looks continuous on screen. A tag split across runs may render fine, or it may fail — you can’t tell by looking. Selecting the entire tag and retyping it collapses it back into a single clean run. When in doubt, delete the tag completely and type it fresh rather than surgically editing it.
One malformed tag fails the entire document — with no error message
This is the most important thing to understand. If a single tag in the template is malformed — a stray \}, a loop whose open and close don’t match, an unsupported expression — the whole document can come back with every tag unreplaced. The raw tag text prints throughout the document, and the generation still reports status: finished. There is no error banner and no failed-generation message; the document simply arrives full of literal \{...\} text.
So when a generated document shows raw tags where merged data should be, do not assume the field is missing or the data is wrong. Assume a single tag somewhere in the template is malformed and is taking the rest of the document down with it. To find it, contact ScopeStack support with the template and a project to test against, and we can check each tag against live merge data and point you to the ones that won’t resolve.
Keep loop tags paired — deleting one half breaks generation
Loops and conditional sections come in pairs: an opening \{#collection\} and a matching closing \{/collection\}, with the repeating content between them.
{#services}
{name} — {extended_hours} hours
{/services}The opening and closing paths must match exactly. If you delete or edit only one half of the pair — a common accident when you’re cleaning up a section of the template — the engine is left with an unbalanced tag, and that unbalanced tag is exactly the kind of malformed tag that fails the whole document (see above). When you remove a looped section, remove both the \{#...\} and its \{/...\}, and when you rename the path, rename it in both places.
Smart quotes and Word’s run-splitting inside prose are harmless
Two things people worry about that are not a problem in tag templates:
- Smart (curly) quotes in body text. Word’s autocorrect turning
"into""in your ordinary document prose does not affect tags. (The one exception is a curly quote inside a tag’s equality check, e.g.\{#state=="Massachusetts"\}— there the quote must stay straight. But that is about the character inside the tag, not the prose around it.) - Word splitting your paragraph text into runs. Word constantly re-chunks text into runs as you type and format; for ordinary template text this is invisible and harmless. It only matters inside a tag, which is why the fix above is to select and retype the whole tag rather than to worry about runs everywhere.
Quick checklist before you re-upload an edited template
- Every tag sits on one line, with no paragraph break inside it.
- Every tag you changed was selected brace-to-brace and retyped, not edited in place.
- Every
\{#...\}has a matching\{/...\}with the identical path. - If the last generated document showed raw tags, contact support to check the template against live merge data and locate the broken tag before assuming the data is at fault.