Skip to content

Conversation

@vaceslav
Copy link
Contributor

Summary

  • Changes the else marker from {{else}} to {{#else}} for consistency with other control flow markers
  • All control flow markers now follow the same pattern: {{#if}}, {{#elseif}}, {{#else}}, {{#foreach}}

BREAKING CHANGE

Existing templates using {{else}} must be updated to {{#else}}.

Changes

  • Updated core regex pattern in ConditionalPatterns.cs
  • Updated 8 source files
  • Updated 10 test files
  • Updated 15+ documentation files
  • Updated Demo, Benchmarks, and DocumentGenerator projects

Test plan

  • All 868 tests pass
  • Format check passes
  • Build succeeds

BREAKING CHANGE: The else marker syntax has changed from {{else}} to {{#else}}
to be consistent with other control flow markers ({{#if}}, {{#elseif}}, {{#foreach}}).

Existing templates using {{else}} must be updated to {{#else}}.
- Fix 2 nested {{else}} in Demo/Program.cs
- Update documentation in REFACTORING.md and TODO.md
- Regenerate conditionals-template.docx with new syntax
- Update screenshots to reflect {{#else}} syntax
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a breaking change to improve syntax consistency across all control flow markers in the templating engine. The change modifies the else marker from {{else}} to {{#else}}, making all control flow markers follow the same pattern with a # prefix: {{#if}}, {{#elseif}}, {{#else}}, {{#foreach}}.

Key Changes:

  • Updated the core regex pattern in ConditionalPatterns.cs to recognize {{#else}} instead of {{else}}
  • Modified 8 source files to handle the new syntax
  • Updated 10+ documentation files with the new syntax examples
  • Regenerated template and output files to reflect the changes

Reviewed changes

Copilot reviewed 37 out of 41 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/index.md Updated main documentation to show {{#else}} in conditional examples
docs/for-template-authors/template-syntax.md Updated all conditional syntax examples and references throughout the template syntax guide
docs/for-template-authors/loops.md Updated conditional examples within loop contexts
docs/for-template-authors/getting-started.md Updated getting started examples to use new syntax
docs/for-template-authors/conditionals.md Comprehensive updates to all conditional documentation and examples
docs/for-developers/text-templates.md Updated text template examples for developers
docs/FAQ.md Updated FAQ examples to reflect new syntax
TriasDev.Templify/Visitors/TemplateElement.cs Updated XML documentation comments
TriasDev.Templify/Visitors/ITemplateElementVisitor.cs Updated interface documentation
TriasDev.Templify/Visitors/DocumentWalker.cs Updated marker detection logic and comments
TriasDev.Templify/Visitors/ConditionalVisitor.cs Updated error messages and marker detection code
TriasDev.Templify/TODO.md Updated implementation notes
TriasDev.Templify/REFACTORING.md Updated refactoring documentation
TriasDev.Templify/README.md Updated feature descriptions and examples
TriasDev.Templify/PERFORMANCE.md Updated performance documentation
TriasDev.Templify/Core/TextTemplateProcessor.cs Updated text template processing logic
examples/templates/conditionals-template.docx Regenerated template file (binary)
examples/outputs/conditionals-output.docx Regenerated output file (binary)
docs/images/examples/outputs/conditionals-output.png Regenerated screenshot (binary)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vaceslav vaceslav merged commit 830963c into main Dec 23, 2025
20 checks passed
@vaceslav vaceslav deleted the feat/else-syntax-consistency branch December 23, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants