Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7280)

Issue 5143048: code review 5143048: exp/template/html: do not escape the RHS of assignments (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by MikeSamuel
Modified:
13 years, 5 months ago
Reviewers:
CC:
nigeltao, r, golang-dev
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r 05f0f5fe5d5e https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 05f0f5fe5d5e https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r c8a7809fabcd https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -1 line) Patch
M src/pkg/exp/template/html/escape.go View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/pkg/exp/template/html/escape_test.go View 1 1 chunk +11 lines, -1 line 0 comments Download

Messages

Total messages: 3
MikeSamuel
Hello nigeltao@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 5 months ago (2011-09-27 20:02:06 UTC) #1
r
LGTM
13 years, 5 months ago (2011-09-27 23:22:45 UTC) #2
MikeSamuel
13 years, 5 months ago (2011-09-28 05:08:18 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=6c5c19791fae ***

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
http://codereview.appspot.com/5143048
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b