summaryrefslogtreecommitdiff
path: root/src/pkg/html/token_test.go
diff options
context:
space:
mode:
authorAndrew Balholm <andybalholm@gmail.com>2011-07-21 09:10:49 +1000
committerAndrew Balholm <andybalholm@gmail.com>2011-07-21 09:10:49 +1000
commitcf8cb4f8f54090897d2227e3dea0ab713cc7ec61 (patch)
tree80548433e02a9d07c33f082ccbd1608dd022ce0f /src/pkg/html/token_test.go
parentf68953c75bcab4ba570976a8e67e126d244922df (diff)
downloadgo-cf8cb4f8f54090897d2227e3dea0ab713cc7ec61.tar.gz
html: handle character entities without semicolons
Fix the TODO: unescape("&notit;") should be "?it;" Also accept digits in entity names. R=nigeltao CC=golang-dev, rsc http://codereview.appspot.com/4781042 Committer: Nigel Tao <nigeltao@golang.org>
Diffstat (limited to 'src/pkg/html/token_test.go')
-rw-r--r--src/pkg/html/token_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pkg/html/token_test.go b/src/pkg/html/token_test.go
index c794612ab..c8dcc8864 100644
--- a/src/pkg/html/token_test.go
+++ b/src/pkg/html/token_test.go
@@ -107,6 +107,16 @@ var tokenTests = []tokenTest{
`<a b="c&noSuchEntity;d">&lt;&alsoDoesntExist;&`,
`<a b="c&amp;noSuchEntity;d">$&lt;&amp;alsoDoesntExist;&amp;`,
},
+ {
+ "entity without semicolon",
+ `&notit;&notin;<a b="q=z&amp=5&notice=hello&not;=world">`,
+ `¬it;∉$<a b="q=z&amp;amp=5&amp;notice=hello¬=world">`,
+ },
+ {
+ "entity with digits",
+ "&frac12;",
+ "½",
+ },
// Attribute tests:
// http://dev.w3.org/html5/spec/Overview.html#attributes-0