TemplateParser: Fix whitespace trim

Bug: 57458
Change-Id: Id916ec3070ef49ea7b2e4d602805596593adcca4
Merge "TemplateParser: Fix whitespace trim"