Skip to content

text/template: Raw quote doesn't allow \n #7323

@gopherbot

Description

@gopherbot

by jeffdh:

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.

Attachments:

  1. text_template_raw_quote.patch (832 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions