final StringBuilder buf = new StringBuilder();
final StringGenerator gen = StringGenerator.create(buf, isSafeHtml);
try {
List<TemplateChunk> chunks = MessageFormatParser.parse(listPattern);
for (TemplateChunk chunk : chunks) {
chunk.accept(new DefaultTemplateChunkVisitor() {
@Override
public void visit(ArgumentChunk argChunk) throws UnableToCompleteException {
// The {0} argument in the list pattern always needs formatting,
// but the {1} argument is the part of the list already rendered
// (in either String of SafeHtml form) unless formatSecond is true.