All rules

Sheath rule

statamic-antlers-region-pairs

Embedded Antlers regions must be balanced and cannot be nested.
Package
Statamic
Category
Blade
Default severity
error by default
Auto-fix
Manual fix

#Why

Statamic treats the first @antlers and @endantlers pair as one embedded Antlers region. Missing, orphaned, or nested markers can cause Blade content to be interpreted as Antlers, or Antlers content to be interpreted as Blade.

#Examples

#Bad

{{-- Nested Antlers regions are not supported. --}}
@antlers
{{ title }}
@antlers {{ subtitle }} @endantlers
@endantlers

#Good

{{-- One balanced region contains both expressions. --}}
@antlers
{{ title }}
{{ subtitle }}
@endantlers

An @antlers without @endantlers and an orphaned @endantlers are also reported.

#Notes

A region with unbalanced or nested markers produces the structural finding without additional Antlers syntax findings from the same region.

#See Also

Related documentation covers Antlers syntax and plugin setup: