]> Cypherpunks repositories - gostls13.git/commit
exp/template/html: simplify transition functions
authorMike Samuel <mikesamuel@gmail.com>
Thu, 22 Sep 2011 02:04:41 +0000 (19:04 -0700)
committerMike Samuel <mikesamuel@gmail.com>
Thu, 22 Sep 2011 02:04:41 +0000 (19:04 -0700)
commit1f577d26d7c7a935c792dacc6cc50826cfd77af0
treef5bed5f7efa48d9166c192f1e4e04c452c7f2249
parent9169c27eaa5d3209b687249b5045c27f73327715
exp/template/html: simplify transition functions

This simplifies transition functions to make it easier to reliably
elide comments in a later CL.

Before:
- transition functions are responsible for detecting special end tags.
After:
- the code to detect special end tags is done in one place.

We were relying on end tags being skipped which meant we were
not noticing comments inside script/style elements that contain no
substitutions.
This change means we will notice all such comments where necessary,
but stripTags will notice none since it does not need to.  This speeds
up stripTags.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5074041
src/pkg/exp/template/html/context.go
src/pkg/exp/template/html/escape.go
src/pkg/exp/template/html/escape_test.go
src/pkg/exp/template/html/html.go
src/pkg/exp/template/html/html_test.go
src/pkg/exp/template/html/transition.go