config property

LiquidConfig? get config

Gets the LiquidConfig for this environment.

This is used by custom tags that need to re-parse content (e.g., block tags with nested Liquid syntax) to use the same delimiters as the parent template.

Example

class MyBlockTag extends AbstractTag with CustomTagParser {
  @override
  dynamic evaluateWithContext(Evaluator evaluator, Buffer buffer) {
    final innerContent = body[0].toString();

    // Get the config to re-parse with the same delimiters
    final config = evaluator.context.config;
    final liquid = Liquid(config: config ?? LiquidConfig.standard);

    // Re-parse and render the inner content
    final result = liquid.renderString(innerContent, evaluator.context.all());
    buffer.write(result);
  }
}

Returns null if the template was parsed with default delimiters using Template.parse instead of Liquid.parse.

Implementation

LiquidConfig? get config => _config;