Split a template into static text and {{slot}} / {{{raw}}} chunks, scanning the string once.
{{slot}}
{{{raw}}}
The template source.
The chunks in order.
Placeholders are the whole syntax: there are no loops, conditionals, filters, includes or comments.
AnzaError TEMPLATE for an unclosed {{ or {{{, or an empty {{}}.
TEMPLATE
{{
{{{
{{}}
import { extract } from '@anzaui/engine';extract('<b>{{title}}</b>{{{body}}}');// [// { type: 'static', value: '<b>' },// { type: 'slot', name: 'title' },// { type: 'static', value: '</b>' },// { type: 'raw', name: 'body' },// ] Copy
import { extract } from '@anzaui/engine';extract('<b>{{title}}</b>{{{body}}}');// [// { type: 'static', value: '<b>' },// { type: 'slot', name: 'title' },// { type: 'static', value: '</b>' },// { type: 'raw', name: 'body' },// ]
Split a template into static text and
{{slot}}/{{{raw}}}chunks, scanning the string once.