-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
Milestone
Description
What steps will reproduce the problem? package main import ( "html/template" "os" ) func main() { t1,_ := template.New("works").Parse("<!DOCTYPE html><html></html>\n") t1.Execute(os.Stdout, nil) t2,_ := template.New("fails").Parse("<!doctype html><html></html>\n") t2.Execute(os.Stdout, nil) } What is the expected output? <!DOCTYPE html><html></html> <!doctype html><html></html> What do you see instead? <!DOCTYPE html><html></html> <!doctype html><html></html> Which compiler are you using (5g, 6g, 8g, gccgo)? Don't know, whatever "go run" uses internally. Which operating system are you using? Windows (x64) Which revision are you using? (hg identify) Prebuilt, downloaded from: http://code.google.com/p/gomingw/downloads/detail?name=gowinamd64_weekly.2012-02-14.zip&;can=2&q= Please provide any additional information below. Line 577 of src/pkg/html/template/escape.go: var doctypeBytes = []byte("<!DOCTYPE") and line 596: if s[j] == '<' && !bytes.HasPrefix(s[j:], doctypeBytes) { look like they are just checking for fixed bytes without normalizing the case. http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#the-doctype clearly says the check should be case insensitive.