Commit e770b5b3 authored by Daniel Martí's avatar Daniel Martí Committed by Rob Pike
Browse files

text/template: allow using -}} with many spaces

lexSpace consumed all spaces, even if the last one was part of a right
delimiter like " -}}". Thus, "3  -}}" wouldn't lex as "3" and a right
delimiter, but as "3", "-", and "}}".

To fix that, make lexSpace stop if it encounters a right delimiter.

Fixes #30948.

Change-Id: I80a5546e5809e54f6823e2bf3a57a7e8808329be
Reviewed-on: https://go-review.googlesource.com/c/go/+/168457


Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
parent b434bbf1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment