astNodesToString function

Future<String> astNodesToString(
  1. List<AstNode> nodes,
  2. RenderContext context
)

Renders nodes in order and concatenates their output.

Implementation

Future<String> astNodesToString(
  List<AstNode> nodes,
  RenderContext context,
) async {
  final buffer = StringBuffer();
  for (final node in nodes) {
    buffer.write(await node.render(context));
  }
  return buffer.toString();
}