]> Cypherpunks repositories - gostls13.git/commit
exp/template/html: fix bug in cssEscaper
authorMike Samuel <mikesamuel@gmail.com>
Tue, 18 Oct 2011 22:01:42 +0000 (17:01 -0500)
committerMike Samuel <mikesamuel@gmail.com>
Tue, 18 Oct 2011 22:01:42 +0000 (17:01 -0500)
commitfc3ce34903d5f86f398eda87ca6e334f483df604
tree1292aa5dfc6d286c76cdeef4ed37d62b86bbd9f5
parentaa42881ed03c23b89f7eab87768f8669851bc0cc
exp/template/html: fix bug in cssEscaper

cssEscaper escapes using the CSS convention: `\` + hex + optional-space

It outputs the space when the escape could be followed by
a hex digit to distinguish a "\na" from "\u00aa".

It did not output a space when the escape is followed by a space
character so did not distinguish "\n " from "\n".

Currently when doing lookahead, it does not distinguish spaces that
will be escaped later by the same function from ones that will not.
This is correct but suboptimal.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5306042
src/pkg/exp/template/html/css.go
src/pkg/exp/template/html/css_test.go