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/+/168457Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Showing
Please register or sign in to comment