(input: string)
| 675 | // section generation so both paths get the same gbrain-aware behavior. |
| 676 | const suppressed = effectiveSuppressedResolvers(hostConfig); |
| 677 | const onePass = (input: string): string => |
| 678 | input.replace(/\{\{(\w+(?::[^}]+)?)\}\}/g, (_match, fullKey) => { |
| 679 | const parts = fullKey.split(':'); |
| 680 | const resolverName = parts[0]; |
| 681 | const args = parts.slice(1); |
| 682 | if (suppressed.has(resolverName)) return ''; |
| 683 | const entry = RESOLVERS[resolverName]; |
| 684 | if (!entry) throw new Error(`Unknown placeholder {{${resolverName}}} in ${relTmplPath}`); |
| 685 | const { resolve, appliesTo } = unwrapResolver(entry); |
| 686 | if (appliesTo && !appliesTo(ctx)) return ''; |
| 687 | return args.length > 0 ? resolve(ctx, args) : resolve(ctx); |
| 688 | }); |
| 689 | |
| 690 | // Multi-pass: a resolver may emit content that itself contains {{TOKENS}} — the |
| 691 | // {{SECTION:id}} resolver inlines a section template (with its own resolvers) |
no test coverage detected