-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
html/template: document that it strips comments #28628
Labels
Documentation
Issues describing a change to documentation.
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Comments
If no one is on it, I would like to give it a try |
Go for it. |
Change https://golang.org/cl/148833 mentions this issue: |
I did update the patch accordingly, @empijei, please do drop anything that I may have missed, 😄 |
Change https://go.dev/cl/658115 mentions this issue: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Documentation
Issues describing a change to documentation.
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
What version of Go are you using (
go version
)?go1.11.1 (playground)
Does this issue reproduce with the latest release?
Yes.
What did you do?
https://play.golang.org/p/WPnEwLYTBkF
What did you expect to see?
Comments preserved in output.
What did you see instead?
Comments are stripped.
This behaviour is apparently intentional (#14256), but it is surprising and undocumented. Templates already have their own special comment syntax (
{{/* */}}
), so i didn't expect that they would gobble up HTML and CSS (and presumably JS) comments as well. This needs to be called out in the documentation, ideally with a rationale and workaround.The text was updated successfully, but these errors were encountered: