Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
text/template: Raw quote doesn't allow \n #7323
Raw quotes within a template cannot include '\n' which seems counter to the golang syntax that does allow '\n'. Here's an example: http://play.golang.org/p/ZDIphkpwDh What is the expected output? The parser should allow the raw quote with the included '\n' What do you see instead? The parser fails thinking the raw quote is unterminated Which version are you using? (run 'go version') First noticed in go1.2, but I see nothing has changed in tip. I've attached a patch that addresses the issue and changes the test to match.
The template language is not Go, however the lexical grammar might be similar. More importantly, the documentation explicitly states that: """" Actions may not span newlines, although comments can. """" #WAI : http://golang.org/pkg/text/template/
I think, it would be useful to have multiline raw. I use swigjs on the frontend which has a very similar syntax and it would be nice to just wrap those blocks to not be processed. For now ive just changed the server's delimiter to work around this.