I am trying to add action "return" to text/template, what should I change in html/template?

113 views
Skip to first unread message

xie cui

unread,
Sep 20, 2022, 9:35:30 PM9/20/22
to golang-dev
https://go-review.googlesource.com/c/go/+/425875/comments/588f71a3_0b3bdd98
the cl is almost done, but rob says that html/template may need changes too.  
I check the code in html/template, It seems html/template has called text/template. after adding action "return" to text/template, I can not find what changes should add to html/template? 

Daniel Martí

unread,
Sep 21, 2022, 3:05:53 AM9/21/22
to xie cui, golang-dev
Have you asked Rob in that CL? :) I'm sure he could clarify what he means.

Rob Pike

unread,
Sep 21, 2022, 3:09:15 AM9/21/22
to Daniel Martí, xie cui, golang-dev
Well, yes, I asked in the first place.

The code in html/template examines the parse tree to decide the
escaping. It will need to know about the new node. Unfortunately, the
code in html/template is an utter mystery to me, so I am not the
person to explain what needs to change while preserving the security
perimeter.

Perhaps someone else can help.

-rob
> --
> You received this message because you are subscribed to the Google Groups "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/20220921070542.54hvmrcmvzdvbuy4%40p14s.localdomain.
Reply all
Reply to author
Forward
0 new messages