]> Cypherpunks repositories - gostls13.git/commit
exp/template/html: do not escape the RHS of assignments
authorMike Samuel <mikesamuel@gmail.com>
Wed, 28 Sep 2011 05:08:14 +0000 (22:08 -0700)
committerMike Samuel <mikesamuel@gmail.com>
Wed, 28 Sep 2011 05:08:14 +0000 (22:08 -0700)
commit260991ad5f1cd73ff9f993bb389ac6d7e56fb509
treed6935900ac88f2454c49ae0bcf531cfbff70c39f
parent71557713b0a7cf53c9c8a80986c89ae4036af74c
exp/template/html: do not escape the RHS of assignments

In

  {{$x := . | foo}}
  {{$x}}

the first action is a variable assignment that contributes
nothing to the output while the first is a use that needs
to be escaped.

This CL fixes escapeAction to distinguish assignments from
interpolations and to only modify interpolations.

R=nigeltao, r
CC=golang-dev
https://golang.org/cl/5143048
src/pkg/exp/template/html/escape.go
src/pkg/exp/template/html/escape_test.go