createTagStart function
Creates a tag start delimiter parser with optional custom config.
Returns a parser that matches the tag start delimiter (e.g., {% or {%-).
The whitespace-stripping variant (e.g., {%-) strips preceding whitespace.
If config is null, uses standard Liquid delimiters.
Example
// Standard delimiters
final tagStart = createTagStart();
// Matches: {% or {%-
// Custom delimiters
final config = LiquidConfig(tagStart: '[%', tagEnd: '%]');
final myTagStart = createTagStart(config);
// Matches: [% or [%-
See also:
- someTag for creating complete tag parsers (recommended)
- createTagEnd for the corresponding end delimiter
Implementation
Parser createTagStart([LiquidConfig? config]) {
final cfg = config ?? LiquidConfig.standard;
return (string(cfg.tagStartStrip).trim() | string(cfg.tagStart)).labeled(
'tagStart',
);
}