diff options
Diffstat (limited to 'src/text/template/parse')
| -rw-r--r-- | src/text/template/parse/lex.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/text/template/parse/lex.go b/src/text/template/parse/lex.go index 6fbf36d7a4..cdecd412ee 100644 --- a/src/text/template/parse/lex.go +++ b/src/text/template/parse/lex.go @@ -281,10 +281,9 @@ func (l *lexer) atRightDelim() (delim, trimSpaces bool) { return true, false } // The right delim might have the marker before. - if strings.HasPrefix(l.input[l.pos:], rightTrimMarker) { - if strings.HasPrefix(l.input[l.pos+trimMarkerLen:], l.rightDelim) { - return true, true - } + if strings.HasPrefix(l.input[l.pos:], rightTrimMarker) && + strings.HasPrefix(l.input[l.pos+trimMarkerLen:], l.rightDelim) { + return true, true } return false, false } |
