diff options
author | Andrew Balholm <andybalholm@gmail.com> | 2011-07-21 09:10:49 +1000 |
---|---|---|
committer | Andrew Balholm <andybalholm@gmail.com> | 2011-07-21 09:10:49 +1000 |
commit | cf8cb4f8f54090897d2227e3dea0ab713cc7ec61 (patch) | |
tree | 80548433e02a9d07c33f082ccbd1608dd022ce0f /src/pkg/html/token_test.go | |
parent | f68953c75bcab4ba570976a8e67e126d244922df (diff) | |
download | go-cf8cb4f8f54090897d2227e3dea0ab713cc7ec61.tar.gz |
html: handle character entities without semicolons
Fix the TODO: unescape("¬it;") 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.go | 10 |
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"><&alsoDoesntExist;&`, `<a b="c&noSuchEntity;d">$<&alsoDoesntExist;&`, }, + { + "entity without semicolon", + `¬it;∉<a b="q=z&=5¬ice=hello¬=world">`, + `¬it;∉$<a b="q=z&amp=5&notice=hello¬=world">`, + }, + { + "entity with digits", + "½", + "½", + }, // Attribute tests: // http://dev.w3.org/html5/spec/Overview.html#attributes-0 |